Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add separator to rpc block_results to identify msg & response pair #2063

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gno.land/pkg/gnoclient/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestCallSingle_Integration(t *testing.T) {
// Execute call
res, err := client.Call(baseCfg, msg)

expected := "(\"hi test argument\" string)"
expected := "(\"hi test argument\" string)\n\n"
got := string(res.DeliverTx.Data)

assert.Nil(t, err)
Expand Down Expand Up @@ -103,7 +103,7 @@ func TestCallMultiple_Integration(t *testing.T) {
Send: "",
}

expected := "(\"it works!\" string)(\"hi test argument\" string)"
expected := "(\"it works!\" string)\n\n(\"hi test argument\" string)\n\n"

// Execute call
res, err := client.Call(baseCfg, msg1, msg2)
Expand Down
1 change: 1 addition & 0 deletions gno.land/pkg/sdk/vm/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func (vm *VMKeeper) Call(ctx sdk.Context, msg MsgCall) (res string, err error) {
res += "\n"
}
}
res += "\n\n" // use `\n\n` as separator to separate results for single tx with multi msgs
return res, nil
// TODO pay for gas? TODO see context?
}
Expand Down
6 changes: 3 additions & 3 deletions gno.land/pkg/sdk/vm/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func Echo(msg string) string {
msg2 := NewMsgCall(addr, coins, pkgPath, "Echo", []string{"hello world"})
res, err := env.vmk.Call(ctx, msg2)
assert.NoError(t, err)
assert.Equal(t, `("echo:hello world" string)`, res)
assert.Equal(t, `("echo:hello world" string)`+"\n\n", res)
// t.Log("result:", res)
}

Expand Down Expand Up @@ -237,7 +237,7 @@ func Echo(msg string) string {
msg2 := NewMsgCall(addr, coins, pkgPath, "Echo", []string{"hello world"})
res, err := env.vmk.Call(ctx, msg2)
assert.NoError(t, err)
assert.Equal(t, `("echo:hello world" string)`, res)
assert.Equal(t, `("echo:hello world" string)`+"\n\n", res)
}

// Sending too much realm package coins fails.
Expand Down Expand Up @@ -333,7 +333,7 @@ func GetAdmin() string {
coins := std.MustParseCoins("")
msg2 := NewMsgCall(addr, coins, pkgPath, "GetAdmin", []string{})
res, err := env.vmk.Call(ctx, msg2)
addrString := fmt.Sprintf("(\"%s\" string)", addr.String())
addrString := fmt.Sprintf("(\"%s\" string)\n\n", addr.String())
assert.NoError(t, err)
assert.Equal(t, addrString, res)
}
Expand Down
Loading