From 140e69ff962d39194a2cc33e4dfff2cd2cf35aa9 Mon Sep 17 00:00:00 2001 From: hh Date: Mon, 14 Feb 2022 11:01:41 +0800 Subject: [PATCH] using clone --- tests/js/erc20.scrypttest.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/js/erc20.scrypttest.js b/tests/js/erc20.scrypttest.js index ba534c03..dba0cdf5 100644 --- a/tests/js/erc20.scrypttest.js +++ b/tests/js/erc20.scrypttest.js @@ -95,8 +95,7 @@ describe('Test sCrypt contract Erc20 In Javascript', () => { const receiverKeyIndex = findKeyIndex(map, receiver); - const erc20 = new ERC20(FIRST_MINT, toHashedMap(map)) - erc20._totalSupply = FIRST_MINT + const erc20 = coin.liberc20.clone(); erc20.balances = toHashedMap(map) let newLockingScript = coin.getNewStateScript({ liberc20: erc20 @@ -145,8 +144,7 @@ describe('Test sCrypt contract Erc20 In Javascript', () => { map.set(receiver, senderBalance - amount) map.set(sender, receiverBalance + amount) - const erc20 = new ERC20(FIRST_MINT, toHashedMap(map)) - erc20._totalSupply = FIRST_MINT + const erc20 = coin.liberc20.clone(); erc20.balances = toHashedMap(map) let newLockingScript = coin.getNewStateScript({ liberc20: erc20 @@ -196,8 +194,7 @@ describe('Test sCrypt contract Erc20 In Javascript', () => { const receiverKeyIndex = findKeyIndex(map, sender); - const erc20 = new ERC20(FIRST_MINT, toHashedMap(map)) - erc20._totalSupply = FIRST_MINT + const erc20 = coin.liberc20.clone(); erc20.balances = toHashedMap(map) let newLockingScript = coin.getNewStateScript({ liberc20: erc20