Improve test coverage for event method signature lookups
This commit is contained in:
parent
602802e5f4
commit
78b8173b37
@ -84,95 +84,135 @@ var _ = Describe("Event signature generator", func() {
|
|||||||
|
|
||||||
Describe("getting the solidity method/event signature from the abi", func() {
|
Describe("getting the solidity method/event signature from the abi", func() {
|
||||||
Describe("it handles methods", func() {
|
Describe("it handles methods", func() {
|
||||||
It("gets the cat file method signature", func() {
|
Describe("from the cat contract", func() {
|
||||||
expected := "file(bytes32,bytes32,address)"
|
It("gets the file method signature", func() {
|
||||||
actual := shared.GetSolidityMethodSignature(shared.CatABI, "file")
|
expected := "file(bytes32,bytes32,address)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.CatABI, "file")
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets the flip dent method signature", func() {
|
Describe("from the drip contract", func() {
|
||||||
expected := "dent(uint256,uint256,uint256)"
|
It("gets the drip method signature", func() {
|
||||||
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "dent")
|
expected := "drip(bytes32)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.DripABI, "drip")
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the file method signature", func() {
|
||||||
|
expected := "file(bytes32,uint256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.DripABI, "file")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets the flip tend method signature", func() {
|
Describe("from the flipper contract", func() {
|
||||||
expected := "tend(uint256,uint256,uint256)"
|
It("gets the deal method signature", func() {
|
||||||
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "tend")
|
expected := "deal(uint256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "deal")
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the dent method signature", func() {
|
||||||
|
expected := "dent(uint256,uint256,uint256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "dent")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the tend method signature", func() {
|
||||||
|
expected := "tend(uint256,uint256,uint256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "tend")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets the pit file deb ceiling method signature", func() {
|
Describe("from the pit contract", func() {
|
||||||
expected := "file(bytes32,address)"
|
It("gets the file method signature", func() {
|
||||||
actual := shared.GetSolidityMethodSignature(shared.PitABI, "file")
|
expected := "file(bytes32,address)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.PitABI, "file")
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets the vat init method signature", func() {
|
Describe("from the vat contract", func() {
|
||||||
expected := "init(bytes32)"
|
It("gets the init method signature", func() {
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "init")
|
expected := "init(bytes32)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "init")
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the heal method signature", func() {
|
||||||
|
expected := "heal(bytes32,bytes32,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "heal")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the fold method signature", func() {
|
||||||
|
expected := "fold(bytes32,bytes32,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "fold")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the flux method signature", func() {
|
||||||
|
expected := "flux(bytes32,bytes32,bytes32,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "flux")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the grab method signature", func() {
|
||||||
|
expected := "grab(bytes32,bytes32,bytes32,bytes32,int256,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "grab")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the move method signature", func() {
|
||||||
|
expected := "move(bytes32,bytes32,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "move")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the slip method signature", func() {
|
||||||
|
expected := "slip(bytes32,bytes32,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "slip")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the toll method signature", func() {
|
||||||
|
expected := "toll(bytes32,bytes32,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "toll")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
|
|
||||||
|
It("gets the tune method signature", func() {
|
||||||
|
expected := "tune(bytes32,bytes32,bytes32,bytes32,int256,int256)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VatABI, "tune")
|
||||||
|
|
||||||
|
Expect(expected).To(Equal(actual))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets the vat heal method signature", func() {
|
Describe("from the vow contract", func() {
|
||||||
expected := "heal(bytes32,bytes32,int256)"
|
It("gets the flog method signature", func() {
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "heal")
|
expected := "flog(uint48)"
|
||||||
|
actual := shared.GetSolidityMethodSignature(shared.VowABI, "flog")
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
Expect(expected).To(Equal(actual))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets the vat init method signature", func() {
|
|
||||||
expected := "fold(bytes32,bytes32,int256)"
|
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "fold")
|
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
|
||||||
})
|
|
||||||
|
|
||||||
It("gets the vat flux method signature", func() {
|
|
||||||
expected := "flux(bytes32,bytes32,bytes32,int256)"
|
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "flux")
|
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
|
||||||
})
|
|
||||||
|
|
||||||
It("gets the flip deal method signature", func() {
|
|
||||||
expected := "deal(uint256)"
|
|
||||||
actual := shared.GetSolidityMethodSignature(shared.FlipperABI, "deal")
|
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
|
||||||
})
|
|
||||||
|
|
||||||
It("gets the vat grab method signature", func() {
|
|
||||||
expected := "grab(bytes32,bytes32,bytes32,bytes32,int256,int256)"
|
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "grab")
|
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
|
||||||
})
|
|
||||||
|
|
||||||
It("gets the vat move method signature", func() {
|
|
||||||
expected := "move(bytes32,bytes32,int256)"
|
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "move")
|
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
|
||||||
})
|
|
||||||
|
|
||||||
It("gets the vat slip method signature", func() {
|
|
||||||
expected := "slip(bytes32,bytes32,int256)"
|
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VatABI, "slip")
|
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
|
||||||
})
|
|
||||||
|
|
||||||
It("gets the flog method signature", func() {
|
|
||||||
expected := "flog(uint48)"
|
|
||||||
actual := shared.GetSolidityMethodSignature(shared.VowABI, "flog")
|
|
||||||
|
|
||||||
Expect(expected).To(Equal(actual))
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user