Skip to content
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

Merged
merged 9 commits into from May 26, 2021

Conversation

tarvos21
Copy link
Collaborator

No description provided.

@tarvos21 tarvos21 requested a review from wk3368 May 26, 2021 07:33
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';
Copy link
Collaborator

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());
});
Copy link
Collaborator

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


export function decodeEventKey(eventKey: string): any {
return decode_event_key(eventKey);
}
Copy link
Collaborator

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

Copy link
Collaborator

@wk3368 wk3368 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tarvos21 tarvos21 merged commit a9bb710 into starcoinorg:master May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants