Skip to content

Commit

Permalink
refactor(aci)!: drop redundant per-method event decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Dec 6, 2021
1 parent e08cec5 commit a84d781
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions docs/guides/contract-events.md
Expand Up @@ -68,10 +68,7 @@ const tx = await client.tx(txHash)

// decode events using contract instance
const decodedUsingInstance = contractInstance.decodeEvents(tx.log)

// OR decode of events using contract instance ACI methods
const decodedUsingInstanceMethods = contractInstance.methods.emitEvents.decodeEvents(tx.log)
console.log(decodedUsingInstanceMethods || decodedUsingInstance)
console.log(decodedUsingInstance)

/*
[
Expand Down
3 changes: 1 addition & 2 deletions src/contract/aci/index.js
Expand Up @@ -290,8 +290,7 @@ export default async function getContractInstance ({
genHandler(name === 'init' ? false : !stateful),
{
get: genHandler(true),
send: genHandler(false),
decodeEvents: events => instance.decodeEvents(events)
send: genHandler(false)
}
)
]
Expand Down
1 change: 0 additions & 1 deletion test/integration/contract-aci.js
Expand Up @@ -274,7 +274,6 @@ describe('Contract instance', function () {
const { log } = await sdk.tx(eventResult.hash)
expect(decodeEvents(log, events)).to.be.eql(eventResult.decodedEvents)
expect(cInstance.decodeEvents(log)).to.be.eql(eventResult.decodedEvents)
expect(cInstance.methods.emitEvents.decodeEvents(log)).to.be.eql(eventResult.decodedEvents)
})

const events = [
Expand Down

0 comments on commit a84d781

Please sign in to comment.