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 deploy Sc #1370

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

add deploy Sc #1370

wants to merge 10 commits into from

Conversation

pivilartisant
Copy link
Contributor

Delivery Quality Checklist

  • Breaking Changes in API:
    Does this PR introduce breaking changes in the API?

    • If yes, have you considered making it backward compatible?
    • If backward compatibility is not considered, set the "breaking-change" label.
  • Changelog:

    • For bugfix PR, set the "bugfix" label
    • If this change should not appear in changelog, use "ignore-for-changelog" label
  • Version Update Handling:
    Have you ensured that the version update by user is handled correctly?

  • PR Dependency:
    Does this PR depend on another PR?

    • If yes, is it necessary for the dependency to be released prior to merging this one?
  • Documentation:

    • Are any necessary changes made to user-facing documentation?
    • Confirm that API documentation is updated with any relevant changes.
    • Check that README and other documentation files are accurate and current.

Comment on lines 18 to 19
//go:embed sc
var content embed.FS
Copy link
Member

Choose a reason for hiding this comment

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

You can directly embed the SC like:

Suggested change
//go:embed sc
var content embed.FS
//go:embed sc/deployer.wasm
var deployerSC []byte

Like that, you don't need to do the content.ReadFile line 31

Comment on lines 21 to 53
func argsKey(offset int) ([]byte, error) {
// Create a buffer to serialize data
var buf bytes.Buffer

// Add U64 (64-bit unsigned integer)
err := binary.Write(&buf, binary.LittleEndian, uint64(offset+1))
if err != nil {
return nil, err
}

// Add Uint8Array equivalent (assuming a single byte array with a 0 value)
buf.Write([]byte{0})

// Return the serialized data
return buf.Bytes(), nil
}

func coinsKey(offset int) ([]byte, error) {
// Create a buffer to serialize data
var buf bytes.Buffer

// Add U64 (64-bit unsigned integer)
err := binary.Write(&buf, binary.LittleEndian, uint64(offset+1))
if err != nil {
return nil, err
}

// Add Uint8Array equivalent (assuming a single byte array with a 0 value)
buf.Write([]byte{1})

// Return the serialized data
return buf.Bytes(), nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
func argsKey(offset int) ([]byte, error) {
// Create a buffer to serialize data
var buf bytes.Buffer
// Add U64 (64-bit unsigned integer)
err := binary.Write(&buf, binary.LittleEndian, uint64(offset+1))
if err != nil {
return nil, err
}
// Add Uint8Array equivalent (assuming a single byte array with a 0 value)
buf.Write([]byte{0})
// Return the serialized data
return buf.Bytes(), nil
}
func coinsKey(offset int) ([]byte, error) {
// Create a buffer to serialize data
var buf bytes.Buffer
// Add U64 (64-bit unsigned integer)
err := binary.Write(&buf, binary.LittleEndian, uint64(offset+1))
if err != nil {
return nil, err
}
// Add Uint8Array equivalent (assuming a single byte array with a 0 value)
buf.Write([]byte{1})
// Return the serialized data
return buf.Bytes(), nil
}
func argsKey(offset int) ([]byte, error) {
// Create a buffer to serialize data
var buf bytes.Buffer
// Add U64 (64-bit unsigned integer)
err := binary.Write(&buf, binary.LittleEndian, uint64(offset+1))
if err != nil {
return nil, err
}
// Add Uint8Array equivalent (assuming a single byte array with a 0 value)
buf.Write([]byte{0})
// Return the serialized data
return buf.Bytes(), nil
}
func coinsKey(offset int) ([]byte, error) {
// Create a buffer to serialize data
var buf bytes.Buffer
// Add U64 (64-bit unsigned integer)
err := binary.Write(&buf, binary.LittleEndian, uint64(offset+1))
if err != nil {
return nil, err
}
// Add Uint8Array equivalent (assuming a single byte array with a 0 value)
buf.Write([]byte{1})
// Return the serialized data
return buf.Bytes(), nil
}

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.

2 participants