@@ -12,15 +12,14 @@ import (
1212)
1313
1414// compile the solidity contract
15-
1615//go:generate sh -c "solc --abi --bin --overwrite @iscmagic=`realpath ../../../vm/core/evm/iscmagic` GetAllowance.sol -o ."
1716
1817var (
1918 //go:embed GetAllowance.abi
20- GetAllowanceContarctABI string
19+ GetAllowanceContractABI string
2120 //go:embed GetAllowance.bin
2221 GetAllowanceContractBytecodeHex string
23- GetAllowanceeContractBytecode = common .FromHex (strings .TrimSpace (GetAllowanceContractBytecodeHex ))
22+ GetAllowanceContractBytecode = common .FromHex (strings .TrimSpace (GetAllowanceContractBytecodeHex ))
2423)
2524
2625func TestGetAllowance (t * testing.T ) {
@@ -30,22 +29,22 @@ func TestGetAllowance(t *testing.T) {
3029 chainID , chainOwnerID , _ := chain .GetInfo ()
3130
3231 t .Log ("chain" , chainID .String ())
33- t .Log ("chain owner ID: " , chainOwnerID .String ())
32+ t .Log ("chain owner ID:" , chainOwnerID .String ())
3433
35- private_key , user_address := chain .NewEthereumAccountWithL2Funds ()
34+ privateKey , userAddress := chain .NewEthereumAccountWithL2Funds ()
3635
37- contract_addr , abi := chain .DeployEVMContract (private_key , GetAllowanceContarctABI , GetAllowanceeContractBytecode , & big.Int {})
36+ contractAddr , abi := chain .DeployEVMContract (privateKey , GetAllowanceContractABI , GetAllowanceContractBytecode , & big.Int {})
3837
39- t .Log ("contract_addr: " , contract_addr , abi )
38+ t .Log ("contract address:" , contractAddr )
39+ t .Log ("contract ABI:" , abi )
4040
41- callArgs , _ := abi .Pack ("getAllowanceFrom" , user_address )
41+ callArgs , _ := abi .Pack ("getAllowanceFrom" , userAddress )
4242 callMsg := ethereum.CallMsg {
43- To : & contract_addr ,
43+ To : & contractAddr ,
4444 Data : callArgs ,
4545 }
4646
4747 result , _ := chain .EVM ().CallContract (callMsg , nil )
4848
49- t .Log ("result: " , result )
50-
49+ t .Log ("result:" , result )
5150}
0 commit comments