aeternity / aepp-sdk-go

Golang SDK to interact with the Æternity blockchain
ISC License
18 stars 10 forks source link

how can use compiler EncodeCalldata #160

Closed 728443778 closed 2 years ago

728443778 commented 2 years ago

hi,please help me, i use

compiler.EncodeCalldata(string(sourceCode), "mint_coin", []string{"aet", "100000000", "aet", "100000"}) the mint_coin sophia func is stateful entrypoint mint_coin(name: string, decimals : int, symbol : string, initial_owner_balance : option(int)) = but ths compiler tell me [{"context":"when checking the application at line 126, column 34 of\n mint_coin : (string, int, string, option(int)) => unit\nto arguments\n aet : string\n 100000000 : int\n aet : string\n 10000000000 : int\n","message":"Cannot unify option(int)\n and int\n","pos":{"col":34,"line":126},"type":"type_error"},{"message":"Unbound variable aet at line 126, column 44\n","pos":{"col":44,"line":126},"type":"type_error"},{"message":"Unbound variable aet at line 126, column 58\n","pos":{"col":58,"line":126},"type":"type_error"}] --- FAIL: TestDeployContract (3.90s) deploContract_test.go:46: [POST /encode-calldata][400] encodeCalldataBadRequest [type_error, Cannot unify option(int) and int so,how can i encode this call func args

728443778 commented 2 years ago

compiler.EncodeCalldata(string(sourceCode), "mint_coin", []string{"\"aet\"", "100000000", "\"aet\"", "Some(100000)"})