From 3b995f96387d21d150ecc82d9ef677456a50bd82 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Thu, 27 Feb 2020 19:25:53 +0100 Subject: [PATCH] Update sdk fork, test better transfer events --- go.mod | 2 +- go.sum | 2 ++ x/wasm/module_test.go | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6087eba..4ef244b 100644 --- a/go.mod +++ b/go.mod @@ -31,4 +31,4 @@ require ( replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // this include a few extra debug helpers on top of cosmos v0.38.1 but original also works fine -replace github.com/cosmos/cosmos-sdk => github.com/confio/cosmos-sdk v0.38.5 +replace github.com/cosmos/cosmos-sdk => github.com/confio/cosmos-sdk v0.38.6 diff --git a/go.sum b/go.sum index c6471e7..068e9f6 100644 --- a/go.sum +++ b/go.sum @@ -42,6 +42,8 @@ github.com/confio/cosmos-sdk v0.38.4 h1:zq564UHdZ7jnyBlKl6UPpUdxUaDsdgV4whoeGZr5 github.com/confio/cosmos-sdk v0.38.4/go.mod h1:xvO/3BXAYyZuyah4c5wekn2chBe+Gx0yaDVdhp0duyo= github.com/confio/cosmos-sdk v0.38.5 h1:C7pYioZREhtK1t7TFgm6JMejaQnmk+qxPKNwI9ZIbKg= github.com/confio/cosmos-sdk v0.38.5/go.mod h1:xvO/3BXAYyZuyah4c5wekn2chBe+Gx0yaDVdhp0duyo= +github.com/confio/cosmos-sdk v0.38.6 h1:WtjLeTkh3pA8HTrWwn2QCr2WX0PH/74fTNZLR7Tymz4= +github.com/confio/cosmos-sdk v0.38.6/go.mod h1:xvO/3BXAYyZuyah4c5wekn2chBe+Gx0yaDVdhp0duyo= github.com/confio/go-cosmwasm v0.6.3 h1:TcZ8k0RsGissZ83JcRMvOu93FpDu2S9XGzCd79xwKyU= github.com/confio/go-cosmwasm v0.6.3/go.mod h1:pHipRby+f3cv97QPLELkzOAlNs/s87uDyhc+SnMn7L4= github.com/confio/go-cosmwasm v0.7.0 h1:15IkIEmAPU22bLYStig/kHw6FoGOxmaaF/kh0hFMGfE= diff --git a/x/wasm/module_test.go b/x/wasm/module_test.go index c609540..55f77e1 100644 --- a/x/wasm/module_test.go +++ b/x/wasm/module_test.go @@ -260,6 +260,9 @@ func TestHandleExecute(t *testing.T) { // this should be standard x/wasm init event, plus 2 bank send event, plus a special event from the contract require.Equal(t, 5, len(res.Events), prettyEvents(res.Events)) assert.Equal(t, "transfer", res.Events[0].Type) + assertAttribute(t, "recipient", contractAddr.String(), res.Events[0].Attributes[0]) + assertAttribute(t, "sender", fred.String(), res.Events[0].Attributes[1]) + assertAttribute(t, "amount", "5000denom", res.Events[0].Attributes[2]) // second part of bank transfer event... FIXME assert.Equal(t, "message", res.Events[1].Type) assertAttribute(t, "sender", fred.String(), res.Events[1].Attributes[0]) @@ -269,6 +272,9 @@ func TestHandleExecute(t *testing.T) { assertAttribute(t, "action", "release", res.Events[2].Attributes[1]) // second transfer (this without conflicting message) assert.Equal(t, "transfer", res.Events[3].Type) + assertAttribute(t, "recipient", bob.String(), res.Events[3].Attributes[0]) + assertAttribute(t, "sender", contractAddr.String(), res.Events[3].Attributes[1]) + assertAttribute(t, "amount", "105000denom", res.Events[3].Attributes[2]) // finally, standard x/wasm tag assert.Equal(t, "message", res.Events[4].Type) assertAttribute(t, "module", "wasm", res.Events[4].Attributes[0])