diff --git a/cairoVM/cmd/main.go b/cairoVM/cmd/main.go index 7f9cbb3..b4e4b2c 100644 --- a/cairoVM/cmd/main.go +++ b/cairoVM/cmd/main.go @@ -1,10 +1,10 @@ package main import ( + "fmt" "testbot/cairoVM" "github.com/NethermindEth/juno/core/felt" - "github.com/davecgh/go-spew/spew" // "github.com/NethermindEth/juno/core" ) @@ -19,7 +19,8 @@ func main() { if err != nil { panic(err) } - spew.Dump(trace) + // spew.Dump(trace) + fmt.Println("trace type ", trace.Type) // declare TX declareTx, class, err := cairoVM.NewDeclare( @@ -34,7 +35,7 @@ func main() { if err != nil { panic(err) } - spew.Dump(trace) + // spew.Dump(trace) invokeTx, err := cairoVM.NewInvoke() if err != nil { @@ -45,6 +46,6 @@ func main() { if err != nil { panic(err) } - spew.Dump(trace) + // spew.Dump(trace) } diff --git a/cairoVM/invoke.go b/cairoVM/invoke.go index aaf764a..e171e90 100644 --- a/cairoVM/invoke.go +++ b/cairoVM/invoke.go @@ -10,7 +10,7 @@ import ( ) var ( - contractMethod string = "set_value" + contractMethod string = "increase_value" ) func NewInvoke() (*core.InvokeTransaction, error) { @@ -22,15 +22,15 @@ func NewInvoke() (*core.InvokeTransaction, error) { // Converting the contractAddress from hex to felt contractAddress := new(felt.Felt).SetUint64(2) - randata := new(felt.Felt).SetUint64(111) + // randata := new(felt.Felt).SetUint64(111) // Building the functionCall struct, where : FnCall := rpc.FunctionCall{ ContractAddress: contractAddress, //contractAddress is the contract that we want to call EntryPointSelector: utils.GetSelectorFromNameFelt(contractMethod), //this is the function that we want to call - Calldata: []*felt.Felt{randata}, //this is the data that we want to pass to the function + //Calldata: []*felt.Felt{randata}, //this is the data that we want to pass to the function } - txCallData := account.FmtCalldataCairo2([]rpc.FunctionCall{FnCall}) + txCallData := account.FmtCalldataCairo0([]rpc.FunctionCall{FnCall}) fmt.Println("invoke calldata = ", txCallData)