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

Redesign callablePointSDKEventAttributes function #45

Open
da1suk8 opened this issue May 8, 2023 · 0 comments
Open

Redesign callablePointSDKEventAttributes function #45

da1suk8 opened this issue May 8, 2023 · 0 comments

Comments

@da1suk8
Copy link
Member

da1suk8 commented May 8, 2023

This function came from #26.

It's a bit weird that the callstack comes first, so move it to the tail.

func callablePointSDKEventAttributes(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress, callstack []byte) ([]sdk.Attribute, error) {
attrs, err := wasmkeeper.ContractSDKEventAttributes(customAttributes, contractAddr)
if err != nil {
return nil, err
}
// attrs[0] is addr
attrs = append([]sdk.Attribute{attrs[0], sdk.NewAttribute(wasmplustypes.AttributeKeyCallstack, string(callstack))}, attrs[1:]...)
return attrs, nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant