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

feat(sol!)!: gen unit/tuple structs for call types with 0/1 param #884

Open
wants to merge 3 commits into
base: yash/err-bindings
Choose a base branch
from

Conversation

yash-atreya
Copy link
Member

@yash-atreya yash-atreya commented Feb 19, 2025

Motivation

Closes #880
Stacked over #883

Solution

sol! {
    function totalSupply() returns (uint256);
    function balanceOf(address) returns (uint256);
}

// Unit struct
pub struct totalSupplyCall;

// Tuple struct
pub struct balanceOfCall(pub Address); // Loses name of the param

// Previously, 
pub struct totalSupplyCall {};
pub struct balanceOfCall { owner: Address }; 
  • Bindings for calls with 2 or more params left unchanged.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@yash-atreya yash-atreya added breaking enhancement New feature or request labels Feb 19, 2025
@yash-atreya yash-atreya changed the base branch from main to yash/err-bindings February 19, 2025 10:29
@yash-atreya yash-atreya changed the title feat(sol!)!: gen unit/tuple structs for call types with 0/1 param feat(sol!)!: gen unit/tuple structs for call types with 0/1 param Feb 19, 2025
@yash-atreya yash-atreya marked this pull request as ready for review February 19, 2025 11:12
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this lgtm

pending @DaniPopes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] feat(sol!)!: improve sol call bindings
2 participants