linter fixes
This commit is contained in:
parent
b49c455df0
commit
2a95648625
@ -25,7 +25,7 @@ func inputDataFromArray(input []byte) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// convert a "from" address into input data which is a left padded 32 byte array
|
// convert a "from" address into input data which is a left padded 32 byte array
|
||||||
func inputDataFromFrom(t *testing.T, ctx context.Context, client *kit.TestFullNode, from address.Address) []byte {
|
func inputDataFromFrom(ctx context.Context, t *testing.T, client *kit.TestFullNode, from address.Address) []byte {
|
||||||
fromId, err := client.StateLookupID(ctx, from, types.EmptyTSK)
|
fromId, err := client.StateLookupID(ctx, from, types.EmptyTSK)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ func TestFEVMBasic(t *testing.T) {
|
|||||||
|
|
||||||
// invoke the contract with owner
|
// invoke the contract with owner
|
||||||
{
|
{
|
||||||
inputData := inputDataFromFrom(t, ctx, client, fromAddr)
|
inputData := inputDataFromFrom(ctx, t, client, fromAddr)
|
||||||
result := client.EVM().InvokeContractByFuncName(ctx, fromAddr, idAddr, "getBalance(address)", inputData)
|
result := client.EVM().InvokeContractByFuncName(ctx, fromAddr, idAddr, "getBalance(address)", inputData)
|
||||||
|
|
||||||
expectedResult, err := hex.DecodeString("0000000000000000000000000000000000000000000000000000000000002710")
|
expectedResult, err := hex.DecodeString("0000000000000000000000000000000000000000000000000000000000002710")
|
||||||
@ -67,7 +67,7 @@ func TestFEVMBasic(t *testing.T) {
|
|||||||
|
|
||||||
// invoke the contract with non owner
|
// invoke the contract with non owner
|
||||||
{
|
{
|
||||||
inputData := inputDataFromFrom(t, ctx, client, fromAddr)
|
inputData := inputDataFromFrom(ctx, t, client, fromAddr)
|
||||||
inputData[31]++ // change the pub address to one that has 0 balance by incrementing the last byte of the address
|
inputData[31]++ // change the pub address to one that has 0 balance by incrementing the last byte of the address
|
||||||
result := client.EVM().InvokeContractByFuncName(ctx, fromAddr, idAddr, "getBalance(address)", inputData)
|
result := client.EVM().InvokeContractByFuncName(ctx, fromAddr, idAddr, "getBalance(address)", inputData)
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ func TestFEVMDelegateCall(t *testing.T) {
|
|||||||
//call Contract Storage which makes a delegatecall to contract Actor
|
//call Contract Storage which makes a delegatecall to contract Actor
|
||||||
//this contract call sets the "counter" variable to 7, from default value 0
|
//this contract call sets the "counter" variable to 7, from default value 0
|
||||||
|
|
||||||
inputDataContract := inputDataFromFrom(t, ctx, client, actorAddr)
|
inputDataContract := inputDataFromFrom(ctx, t, client, actorAddr)
|
||||||
inputDataValue := inputDataFromArray([]byte{7})
|
inputDataValue := inputDataFromArray([]byte{7})
|
||||||
inputData := append(inputDataContract, inputDataValue...)
|
inputData := append(inputDataContract, inputDataValue...)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user