From 65dc473ae7328979bbfbef75ba8d1a214677f6bb Mon Sep 17 00:00:00 2001 From: Arpan Pujara <“arpan@matic.network”> Date: Tue, 25 Jan 2022 21:14:17 +0530 Subject: [PATCH] updated values for generic contract call --- services/construction/preprocess.go | 4 ---- services/construction/preprocess_test.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/services/construction/preprocess.go b/services/construction/preprocess.go index d83b1f4..5ff62e2 100644 --- a/services/construction/preprocess.go +++ b/services/construction/preprocess.go @@ -154,7 +154,6 @@ func (a *APIService) ConstructionPreprocess( } preprocessOutputOptions.ContractAddress = checkTo preprocessOutputOptions.Data = data - preprocessOutputOptions.Value = big.NewInt(0) // MATIC value is 0 in any contract call preprocessOutputOptions.MethodSignature = methodSigStringObj preprocessOutputOptions.MethodArgs = methodArgs @@ -181,7 +180,6 @@ func matchTransferOperations(operations []*types.Operation, isContractCall bool) if err != nil { log.Fatal(err) } - fmt.Println("in 0 value") valueTwo, err := strconv.ParseInt(operations[1].Amount.Value, 10, 64) if err != nil { log.Fatal(err) @@ -223,8 +221,6 @@ func matchTransferOperations(operations []*types.Operation, isContractCall bool) return nil, nil, err } - fmt.Println("matches..!!", matches[0]) - fromOp, _ := matches[0].First() toOp, _ := matches[1].First() diff --git a/services/construction/preprocess_test.go b/services/construction/preprocess_test.go index 91e9557..237a59e 100644 --- a/services/construction/preprocess_test.go +++ b/services/construction/preprocess_test.go @@ -122,7 +122,7 @@ func TestPreprocess(t *testing.T) { Options: map[string]interface{}{ "from": preprocessFromAddress, "to": preprocessToAddress, // it will be contract address user need to pass in operation - "value": "0x0", + "value": "0x1", "contract_address": preprocessToAddress, "data": preprocessGenericData, "nonce": "0x22",