Skip to content

Commit

Permalink
Add returndata check on event emission
Browse files Browse the repository at this point in the history
  • Loading branch information
i-stam committed Aug 12, 2019
1 parent 6ce8858 commit 6c4fe8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/wallet/execute_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ var _ = Describe("executeTransaction", func() {
Expect(evt.Destination).To(Equal(randomAddress))
Expect(evt.Value.String()).To(Equal(FinneyToWei(500).String()))
Expect(evt.Data).To(Equal([]uint8{}))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("")))
})
})

Expand Down Expand Up @@ -110,6 +111,7 @@ var _ = Describe("executeTransaction", func() {
Expect(err).ToNot(HaveOccurred())
ed, _ := a.Pack("transfer", randomAddress, big.NewInt(300))
Expect(evt.Data).To(Equal(ed))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("")))
})
})

Expand Down Expand Up @@ -161,6 +163,7 @@ var _ = Describe("executeTransaction", func() {
Expect(evt.Destination).To(Equal(randomAddress))
Expect(evt.Value.String()).To(Equal(EthToWei(100).String()))
Expect(evt.Data).To(Equal([]uint8{}))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("")))
})
})

Expand Down Expand Up @@ -207,6 +210,7 @@ var _ = Describe("executeTransaction", func() {
Expect(evt.Value.String()).To(Equal(FinneyToWei(500).String()))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("")))
Expect(evt.Data).To(Equal([]uint8{}))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("")))
})
})

Expand Down Expand Up @@ -271,11 +275,11 @@ var _ = Describe("executeTransaction", func() {
Expect(it.Next()).To(BeFalse())
Expect(evt.Destination).To(Equal(TKNBurnerAddress))
Expect(evt.Value.String()).To(Equal("0"))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001")))
a, err := abi.JSON(strings.NewReader(ERC20ABI))
Expect(err).ToNot(HaveOccurred())
ed, _ := a.Pack("burn", big.NewInt(300))
Expect(evt.Data).To(Equal(ed))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001")))
})
})

Expand Down Expand Up @@ -325,6 +329,7 @@ var _ = Describe("executeTransaction", func() {
Expect(err).ToNot(HaveOccurred())
ed, _ := a.Pack("transfer", RandomAccount.Address(), big.NewInt(300))
Expect(evt.Data).To(Equal(ed))
Expect(evt.Returndata).To(Equal(common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000001")))
})
})

Expand Down

0 comments on commit 6c4fe8d

Please sign in to comment.