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
Add decodeEventData and decodeEventKey functions and test cases #23
Conversation
src/index.ts
Outdated
@@ -7,4 +7,5 @@ export * as onchain_event_types from './lib/runtime/onchain_events'; | |||
export * as providers from './providers'; | |||
export * as crypto_hash from './crypto_hash'; | |||
export * as encoding from './encoding'; | |||
export * as decode_event from './onchain-events/decode-event'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change
onchain-events/decode-event
to
onchain_events/decode_event
new folder/files name should keep the same name pattern with the older ones.
const eventData = '0x00ca9a3b00000000000000000000000000000000000000000000000000000001035354430353544300'; | ||
const result = decodeEventData(eventName, eventData); | ||
console.log(result.toJS()); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const result = decodeEventData(eventName, eventData);
console.log(result.toJS());
thses two method should merge into one , and exported to the merged one
src/onchain-events/decode-event.ts
Outdated
|
||
export function decodeEventKey(eventKey: string): any { | ||
return decode_event_key(eventKey); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move these 2 exported methods from this folder to the encoding folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.