Skip to content

Commit

Permalink
updated values for generic contract call
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpan Pujara committed Jan 25, 2022
1 parent 032d555 commit 65dc473
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions services/construction/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion services/construction/preprocess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 65dc473

Please sign in to comment.