difftreelog
refactor rename function
in: master
11 files changed
pallets/unique/src/eth/mod.rsdiffbeforeafterboth--- a/pallets/unique/src/eth/mod.rs
+++ b/pallets/unique/src/eth/mod.rs
@@ -245,6 +245,7 @@
}
#[weight(<SelfWeightOf<T>>::create_collection())]
+ #[solidity(rename_selector = "createRFTCollection")]
fn create_refungible_collection(
&mut self,
caller: caller,
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth--- a/pallets/unique/src/eth/stubs/CollectionHelpers.sol
+++ b/pallets/unique/src/eth/stubs/CollectionHelpers.sol
@@ -30,7 +30,7 @@
}
/// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0x675f3074
+/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1
contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
/// Create an NFT collection
/// @param name Name of the collection
@@ -69,9 +69,9 @@
return 0x0000000000000000000000000000000000000000;
}
- /// @dev EVM selector for this function is: 0x44a68ad5,
- /// or in textual repr: createRefungibleCollection(string,string,string)
- function createRefungibleCollection(
+ /// @dev EVM selector for this function is: 0xab173450,
+ /// or in textual repr: createRFTCollection(string,string,string)
+ function createRFTCollection(
string memory name,
string memory description,
string memory tokenPrefix
tests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/CollectionHelpers.sol
+++ b/tests/src/eth/api/CollectionHelpers.sol
@@ -21,7 +21,7 @@
}
/// @title Contract, which allows users to operate with collections
-/// @dev the ERC-165 identifier for this interface is 0x675f3074
+/// @dev the ERC-165 identifier for this interface is 0x88ee8ef1
interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
/// Create an NFT collection
/// @param name Name of the collection
@@ -45,9 +45,9 @@
string memory baseUri
) external returns (address);
- /// @dev EVM selector for this function is: 0x44a68ad5,
- /// or in textual repr: createRefungibleCollection(string,string,string)
- function createRefungibleCollection(
+ /// @dev EVM selector for this function is: 0xab173450,
+ /// or in textual repr: createRFTCollection(string,string,string)
+ function createRFTCollection(
string memory name,
string memory description,
string memory tokenPrefix
tests/src/eth/collectionHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/collectionHelpersAbi.json
+++ b/tests/src/eth/collectionHelpersAbi.json
@@ -59,7 +59,7 @@
{ "internalType": "string", "name": "description", "type": "string" },
{ "internalType": "string", "name": "tokenPrefix", "type": "string" }
],
- "name": "createRefungibleCollection",
+ "name": "createRFTCollection",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "nonpayable",
"type": "function"
tests/src/eth/createRFTCollection.test.tsdiffbeforeafterboth--- a/tests/src/eth/createRFTCollection.test.ts
+++ b/tests/src/eth/createRFTCollection.test.ts
@@ -41,7 +41,7 @@
const collectionCountBefore = await getCreatedCollectionCount(api);
const result = await collectionHelper.methods
- .createRefungibleCollection(collectionName, description, tokenPrefix)
+ .createRFTCollection(collectionName, description, tokenPrefix)
.send();
const collectionCountAfter = await getCreatedCollectionCount(api);
@@ -65,7 +65,7 @@
.call()).to.be.false;
await collectionHelpers.methods
- .createRefungibleCollection('A', 'A', 'A')
+ .createRFTCollection('A', 'A', 'A')
.send();
expect(await collectionHelpers.methods
@@ -76,7 +76,7 @@
itWeb3('Set sponsorship', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelpers = evmCollectionHelpers(web3, owner);
- let result = await collectionHelpers.methods.createRefungibleCollection('Sponsor collection', '1', '1').send();
+ let result = await collectionHelpers.methods.createRFTCollection('Sponsor collection', '1', '1').send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
const sponsor = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});
@@ -96,7 +96,7 @@
itWeb3('Set limits', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelpers = evmCollectionHelpers(web3, owner);
- const result = await collectionHelpers.methods.createRefungibleCollection('Const collection', '5', '5').send();
+ const result = await collectionHelpers.methods.createRFTCollection('Const collection', '5', '5').send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
const limits = {
accountTokenOwnershipLimit: 1000,
@@ -141,7 +141,7 @@
.isCollectionExist(collectionAddressForNonexistentCollection).call())
.to.be.false;
- const result = await collectionHelpers.methods.createRefungibleCollection('Collection address exist', '7', '7').send();
+ const result = await collectionHelpers.methods.createRFTCollection('Collection address exist', '7', '7').send();
const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
expect(await collectionHelpers.methods
.isCollectionExist(collectionIdAddress).call())
@@ -164,7 +164,7 @@
const tokenPrefix = 'A';
await expect(helper.methods
- .createRefungibleCollection(collectionName, description, tokenPrefix)
+ .createRFTCollection(collectionName, description, tokenPrefix)
.call()).to.be.rejectedWith('name is too long. Max length is ' + MAX_NAME_LENGHT);
}
@@ -174,7 +174,7 @@
const description = 'A'.repeat(MAX_DESCRIPTION_LENGHT + 1);
const tokenPrefix = 'A';
await expect(helper.methods
- .createRefungibleCollection(collectionName, description, tokenPrefix)
+ .createRFTCollection(collectionName, description, tokenPrefix)
.call()).to.be.rejectedWith('description is too long. Max length is ' + MAX_DESCRIPTION_LENGHT);
}
{
@@ -183,7 +183,7 @@
const description = 'A';
const tokenPrefix = 'A'.repeat(MAX_TOKEN_PREFIX_LENGHT + 1);
await expect(helper.methods
- .createRefungibleCollection(collectionName, description, tokenPrefix)
+ .createRFTCollection(collectionName, description, tokenPrefix)
.call()).to.be.rejectedWith('token_prefix is too long. Max length is ' + MAX_TOKEN_PREFIX_LENGHT);
}
});
@@ -196,7 +196,7 @@
const tokenPrefix = 'A';
await expect(helper.methods
- .createRefungibleCollection(collectionName, description, tokenPrefix)
+ .createRFTCollection(collectionName, description, tokenPrefix)
.call()).to.be.rejectedWith('NotSufficientFounds');
});
@@ -204,7 +204,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const notOwner = createEthAccount(web3);
const collectionHelpers = evmCollectionHelpers(web3, owner);
- const result = await collectionHelpers.methods.createRefungibleCollection('A', 'A', 'A').send();
+ const result = await collectionHelpers.methods.createRFTCollection('A', 'A', 'A').send();
const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
const contractEvmFromNotOwner = evmCollection(web3, notOwner, collectionIdAddress, {type: 'ReFungible'});
const EXPECTED_ERROR = 'NoPermission';
@@ -229,7 +229,7 @@
itWeb3('(!negative test!) Set limits', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const collectionHelpers = evmCollectionHelpers(web3, owner);
- const result = await collectionHelpers.methods.createRefungibleCollection('Schema collection', 'A', 'A').send();
+ const result = await collectionHelpers.methods.createRFTCollection('Schema collection', 'A', 'A').send();
const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
const collectionEvm = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});
await expect(collectionEvm.methods
tests/src/eth/fractionalizer/Fractionalizer.soldiffbeforeafterboth--- a/tests/src/eth/fractionalizer/Fractionalizer.sol
+++ b/tests/src/eth/fractionalizer/Fractionalizer.sol
@@ -25,7 +25,9 @@
/// @dev Method modifier to only allow contract owner to call it.
modifier onlyOwner() {
address contracthelpersAddress = 0x842899ECF380553E8a4de75bF534cdf6fBF64049;
- ContractHelpers contractHelpers = ContractHelpers(contracthelpersAddress);
+ ContractHelpers contractHelpers = ContractHelpers(
+ contracthelpersAddress
+ );
address contractOwner = contractHelpers.contractOwner(address(this));
require(msg.sender == contractOwner, "Only owner can");
_;
@@ -38,10 +40,19 @@
event AllowListSet(address _collection, bool _status);
/// @dev This emits when NFT token is fractionalized by contract.
- event Fractionalized(address _collection, uint256 _tokenId, address _rftToken, uint128 _amount);
+ event Fractionalized(
+ address _collection,
+ uint256 _tokenId,
+ address _rftToken,
+ uint128 _amount
+ );
/// @dev This emits when NFT token is defractionalized by contract.
- event Defractionalized(address _rftToken, address _nftCollection, uint256 _nftTokenId);
+ event Defractionalized(
+ address _rftToken,
+ address _nftCollection,
+ uint256 _nftTokenId
+ );
/// Set RFT collection that contract will work with. RFT tokens for fractionalized NFT tokens
/// would be created in this collection.
@@ -52,13 +63,11 @@
/// Can only be called by contract owner.
/// @param _collection address of RFT collection.
function setRFTCollection(address _collection) public onlyOwner {
- require(
- rftCollection == address(0),
- "RFT collection is already set"
- );
+ require(rftCollection == address(0), "RFT collection is already set");
UniqueRefungible refungibleContract = UniqueRefungible(_collection);
- string memory collectionType = refungibleContract.uniqueCollectionType();
-
+ string memory collectionType = refungibleContract
+ .uniqueCollectionType();
+
require(
keccak256(bytes(collectionType)) == refungibleCollectionType,
"Wrong collection type. Collection is not refungible."
@@ -78,13 +87,15 @@
/// @param _name name for created RFT collection.
/// @param _description description for created RFT collection.
/// @param _tokenPrefix token prefix for created RFT collection.
- function createAndSetRFTCollection(string calldata _name, string calldata _description, string calldata _tokenPrefix) public onlyOwner {
- require(
- rftCollection == address(0),
- "RFT collection is already set"
- );
+ function createAndSetRFTCollection(
+ string calldata _name,
+ string calldata _description,
+ string calldata _tokenPrefix
+ ) public onlyOwner {
+ require(rftCollection == address(0), "RFT collection is already set");
address collectionHelpers = 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F;
- rftCollection = CollectionHelpers(collectionHelpers).createRefungibleCollection(_name, _description, _tokenPrefix);
+ rftCollection = CollectionHelpers(collectionHelpers)
+ .createRFTCollection(_name, _description, _tokenPrefix);
emit RFTCollectionSet(rftCollection);
}
@@ -92,7 +103,10 @@
/// @dev Can only be called by contract owner.
/// @param collection NFT token address.
/// @param status `true` to allow and `false` to disallow NFT token.
- function setNftCollectionIsAllowed(address collection, bool status) public onlyOwner {
+ function setNftCollectionIsAllowed(address collection, bool status)
+ public
+ onlyOwner
+ {
nftCollectionAllowList[collection] = status;
emit AllowListSet(collection, status);
}
@@ -107,12 +121,15 @@
/// @param _collection NFT collection address
/// @param _token id of NFT token to be fractionalized
/// @param _pieces number of pieces new RFT token would have
- function nft2rft(address _collection, uint256 _token, uint128 _pieces) public {
- require(
- rftCollection != address(0),
- "RFT collection is not set"
+ function nft2rft(
+ address _collection,
+ uint256 _token,
+ uint128 _pieces
+ ) public {
+ require(rftCollection != address(0), "RFT collection is not set");
+ UniqueRefungible rftCollectionContract = UniqueRefungible(
+ rftCollection
);
- UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection);
require(
nftCollectionAllowList[_collection] == true,
"Fractionalization of this collection is not allowed by admin"
@@ -121,25 +138,25 @@
UniqueNFT(_collection).ownerOf(_token) == msg.sender,
"Only token owner could fractionalize it"
);
- UniqueNFT(_collection).transferFrom(
- msg.sender,
- address(this),
- _token
- );
+ UniqueNFT(_collection).transferFrom(msg.sender, address(this), _token);
uint256 rftTokenId;
address rftTokenAddress;
UniqueRefungibleToken rftTokenContract;
if (nft2rftMapping[_collection][_token] == 0) {
rftTokenId = rftCollectionContract.nextTokenId();
rftCollectionContract.mint(address(this), rftTokenId);
- rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId);
+ rftTokenAddress = rftCollectionContract.tokenContractAddress(
+ rftTokenId
+ );
nft2rftMapping[_collection][_token] = rftTokenId;
rft2nftMapping[rftTokenAddress] = Token(_collection, _token);
rftTokenContract = UniqueRefungibleToken(rftTokenAddress);
} else {
rftTokenId = nft2rftMapping[_collection][_token];
- rftTokenAddress = rftCollectionContract.tokenContractAddress(rftTokenId);
+ rftTokenAddress = rftCollectionContract.tokenContractAddress(
+ rftTokenId
+ );
rftTokenContract = UniqueRefungibleToken(rftTokenAddress);
}
rftTokenContract.repartition(_pieces);
@@ -157,24 +174,25 @@
/// @param _collection RFT collection address
/// @param _token id of RFT token
function rft2nft(address _collection, uint256 _token) public {
- require(
- rftCollection != address(0),
- "RFT collection is not set"
+ require(rftCollection != address(0), "RFT collection is not set");
+ require(rftCollection == _collection, "Wrong RFT collection");
+ UniqueRefungible rftCollectionContract = UniqueRefungible(
+ rftCollection
);
- require(
- rftCollection == _collection,
- "Wrong RFT collection"
+ address rftTokenAddress = rftCollectionContract.tokenContractAddress(
+ _token
);
- UniqueRefungible rftCollectionContract = UniqueRefungible(rftCollection);
- address rftTokenAddress = rftCollectionContract.tokenContractAddress(_token);
Token memory nftToken = rft2nftMapping[rftTokenAddress];
require(
nftToken._collection != address(0),
"No corresponding NFT token found"
);
- UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken(rftTokenAddress);
+ UniqueRefungibleToken rftTokenContract = UniqueRefungibleToken(
+ rftTokenAddress
+ );
require(
- rftTokenContract.balanceOf(msg.sender) == rftTokenContract.totalSupply(),
+ rftTokenContract.balanceOf(msg.sender) ==
+ rftTokenContract.totalSupply(),
"Not all pieces are owned by the caller"
);
rftCollectionContract.transferFrom(msg.sender, address(this), _token);
@@ -183,6 +201,10 @@
msg.sender,
nftToken._tokenId
);
- emit Defractionalized(rftTokenAddress, nftToken._collection, nftToken._tokenId);
+ emit Defractionalized(
+ rftTokenAddress,
+ nftToken._collection,
+ nftToken._tokenId
+ );
}
-}
\ No newline at end of file
+}
tests/src/eth/fractionalizer/fractionalizer.test.tsdiffbeforeafterboth--- a/tests/src/eth/fractionalizer/fractionalizer.test.ts
+++ b/tests/src/eth/fractionalizer/fractionalizer.test.ts
@@ -21,7 +21,7 @@
import {readFile} from 'fs/promises';
import {executeTransaction, submitTransactionAsync} from '../../substrate/substrate-api';
import {getCreateCollectionResult, getCreateItemResult, UNIQUE, requirePallets, Pallets} from '../../util/helpers';
-import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRefungibleCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';
+import {collectionIdToAddress, CompiledContract, createEthAccountWithBalance, createNonfungibleCollection, createRFTCollection, GAS_ARGS, itWeb3, tokenIdFromAddress, uniqueNFT, uniqueRefungible, uniqueRefungibleToken} from '../util/helpers';
import {Contract} from 'web3-eth-contract';
import * as solc from 'solc';
@@ -123,7 +123,7 @@
itWeb3('Set RFT collection', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const fractionalizer = await deployFractionalizer(web3, owner);
- const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);
+ const {collectionIdAddress} = await createRFTCollection(api, web3, owner);
const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner);
await refungibleContract.methods.addCollectionAdmin(fractionalizer.options.address).send();
const result = await fractionalizer.methods.setRFTCollection(collectionIdAddress).send();
@@ -256,7 +256,7 @@
itWeb3('call setRFTCollection twice', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);
+ const {collectionIdAddress} = await createRFTCollection(api, web3, owner);
const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner);
const fractionalizer = await deployFractionalizer(web3, owner);
@@ -282,7 +282,7 @@
itWeb3('call setRFTCollection while not collection admin', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const fractionalizer = await deployFractionalizer(web3, owner);
- const {collectionIdAddress} = await createRefungibleCollection(api, web3, owner);
+ const {collectionIdAddress} = await createRFTCollection(api, web3, owner);
await expect(fractionalizer.methods.setRFTCollection(collectionIdAddress).call())
.to.be.rejectedWith(/Fractionalizer contract should be an admin of the collection$/g);
@@ -368,7 +368,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const fractionalizer = await deployFractionalizer(web3, owner);
- const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner);
+ const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner);
const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner);
const rftTokenId = await refungibleContract.methods.nextTokenId().call();
await refungibleContract.methods.mint(owner, rftTokenId).send();
@@ -381,7 +381,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const {fractionalizer} = await initFractionalizer(api, web3, privateKeyWrapper, owner);
- const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner);
+ const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner);
const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner);
const rftTokenId = await refungibleContract.methods.nextTokenId().call();
await refungibleContract.methods.mint(owner, rftTokenId).send();
@@ -392,7 +392,7 @@
itWeb3('call rft2nft for RFT token that was not minted by fractionalizer contract', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const {collectionIdAddress: rftCollectionAddress} = await createRefungibleCollection(api, web3, owner);
+ const {collectionIdAddress: rftCollectionAddress} = await createRFTCollection(api, web3, owner);
const fractionalizer = await deployFractionalizer(web3, owner);
const refungibleContract = uniqueRefungible(web3, rftCollectionAddress, owner);
tests/src/eth/reFungible.test.tsdiffbeforeafterboth26 itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {26 itWeb3('totalSupply', async ({api, web3, privateKeyWrapper}) => {27 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);27 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);28 const helper = evmCollectionHelpers(web3, caller);28 const helper = evmCollectionHelpers(web3, caller);29 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();29 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();30 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);30 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);31 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});31 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});32 const nextTokenId = await contract.methods.nextTokenId().call();32 const nextTokenId = await contract.methods.nextTokenId().call();38 itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => {38 itWeb3('balanceOf', async ({api, web3, privateKeyWrapper}) => {39 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);39 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);40 const helper = evmCollectionHelpers(web3, caller);40 const helper = evmCollectionHelpers(web3, caller);41 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();41 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();42 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);42 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);43 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});43 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});444463 itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => {63 itWeb3('ownerOf', async ({api, web3, privateKeyWrapper}) => {64 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);64 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);65 const helper = evmCollectionHelpers(web3, caller);65 const helper = evmCollectionHelpers(web3, caller);66 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();66 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();67 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);67 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);68 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});68 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});696979 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);79 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);80 const receiver = createEthAccount(web3);80 const receiver = createEthAccount(web3);81 const helper = evmCollectionHelpers(web3, caller);81 const helper = evmCollectionHelpers(web3, caller);82 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();82 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();83 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);83 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);84 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});84 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});8585103 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);103 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);104 const receiver = createEthAccount(web3);104 const receiver = createEthAccount(web3);105 const helper = evmCollectionHelpers(web3, caller);105 const helper = evmCollectionHelpers(web3, caller);106 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();106 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();107 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);107 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);108 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});108 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});109109130 itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => {130 itWeb3('Can perform mint()', async ({web3, api, privateKeyWrapper}) => {131 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);131 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);132 const helper = evmCollectionHelpers(web3, owner);132 const helper = evmCollectionHelpers(web3, owner);133 let result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();133 let result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();134 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);134 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);135 const receiver = createEthAccount(web3);135 const receiver = createEthAccount(web3);136 const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});136 const contract = evmCollection(web3, owner, collectionIdAddress, {type: 'ReFungible'});163 itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => {163 itWeb3('Can perform mintBulk()', async ({web3, api, privateKeyWrapper}) => {164 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);164 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);165 const helper = evmCollectionHelpers(web3, caller);165 const helper = evmCollectionHelpers(web3, caller);166 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();166 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();167 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);167 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);168 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});168 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});169169221 itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => {221 itWeb3('Can perform burn()', async ({web3, api, privateKeyWrapper}) => {222 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);222 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);223 const helper = evmCollectionHelpers(web3, caller);223 const helper = evmCollectionHelpers(web3, caller);224 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();224 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();225 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);225 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);226 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});226 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});227227247 itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => {247 itWeb3('Can perform transferFrom()', async ({web3, api, privateKeyWrapper}) => {248 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);248 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);249 const helper = evmCollectionHelpers(web3, caller);249 const helper = evmCollectionHelpers(web3, caller);250 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();250 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();251 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);251 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);252 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});252 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});253253304 itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => {304 itWeb3('Can perform transfer()', async ({web3, api, privateKeyWrapper}) => {305 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);305 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);306 const helper = evmCollectionHelpers(web3, caller);306 const helper = evmCollectionHelpers(web3, caller);307 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();307 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();308 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);308 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);309 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});309 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});310310344 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);344 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);345 const receiver = createEthAccount(web3);345 const receiver = createEthAccount(web3);346 const helper = evmCollectionHelpers(web3, caller);346 const helper = evmCollectionHelpers(web3, caller);347 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();347 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();348 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);348 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);349 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});349 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});350350376 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);376 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);377 const receiver = createEthAccount(web3);377 const receiver = createEthAccount(web3);378 const helper = evmCollectionHelpers(web3, caller);378 const helper = evmCollectionHelpers(web3, caller);379 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();379 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();380 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);380 const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);381 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});381 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});382382413 itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {413 itWeb3('transferFrom() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {414 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);414 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);415 const helper = evmCollectionHelpers(web3, caller);415 const helper = evmCollectionHelpers(web3, caller);416 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();416 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();417 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);417 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);418 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});418 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});419419430 itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {430 itWeb3('transfer() call fee is less than 0.2UNQ', async ({web3, api, privateKeyWrapper}) => {431 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);431 const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);432 const helper = evmCollectionHelpers(web3, caller);432 const helper = evmCollectionHelpers(web3, caller);433 const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();433 const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();434 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);434 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);435 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});435 const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});436436tests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth--- a/tests/src/eth/reFungibleToken.test.ts
+++ b/tests/src/eth/reFungibleToken.test.ts
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {approve, createCollection, createRefungibleToken, transfer, transferFrom, UNIQUE, requirePallets, Pallets} from '../util/helpers';
-import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRefungibleCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers';
+import {collectionIdToAddress, createEthAccount, createEthAccountWithBalance, createRFTCollection, evmCollection, evmCollectionHelpers, getCollectionAddressFromResult, itWeb3, normalizeEvents, recordEthFee, recordEvents, subToEth, tokenIdToAddress, transferBalanceToEth, uniqueRefungible, uniqueRefungibleToken} from './util/helpers';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
@@ -458,7 +458,7 @@
const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const receiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const helper = evmCollectionHelpers(web3, caller);
- const result = await helper.methods.createRefungibleCollection('Mint collection', '6', '6').send();
+ const result = await helper.methods.createRFTCollection('Mint collection', '6', '6').send();
const {collectionIdAddress, collectionId} = await getCollectionAddressFromResult(api, result);
const contract = evmCollection(web3, caller, collectionIdAddress, {type: 'ReFungible'});
@@ -658,7 +658,7 @@
itWeb3('Default parent token address and id', async ({api, web3, privateKeyWrapper}) => {
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const {collectionIdAddress, collectionId} = await createRefungibleCollection(api, web3, owner);
+ const {collectionIdAddress, collectionId} = await createRFTCollection(api, web3, owner);
const refungibleContract = uniqueRefungible(web3, collectionIdAddress, owner);
const refungibleTokenId = await refungibleContract.methods.nextTokenId().call();
await refungibleContract.methods.mint(owner, refungibleTokenId).send();
tests/src/eth/util/helpers.tsdiffbeforeafterboth--- a/tests/src/eth/util/helpers.ts
+++ b/tests/src/eth/util/helpers.ts
@@ -141,10 +141,10 @@
expect(result.success).to.be.true;
}
-export async function createRefungibleCollection(api: ApiPromise, web3: Web3, owner: string) {
+export async function createRFTCollection(api: ApiPromise, web3: Web3, owner: string) {
const collectionHelper = evmCollectionHelpers(web3, owner);
const result = await collectionHelper.methods
- .createRefungibleCollection('A', 'B', 'C')
+ .createRFTCollection('A', 'B', 'C')
.send();
return await getCollectionAddressFromResult(api, result);
}