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

chore: Optimize Smart Contract API input and add more tests #350

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

jianlunz-cb
Copy link

@jianlunz-cb jianlunz-cb commented Dec 19, 2024

What changed? Why?

> let sc = await SmartContract.register({networkId: "base-sepolia", contractAddress: "0x0000000071727de22e5e9d8baf0edac6f37da053", abi: [{constant: true,name: "myField",outputs: [{name: "",type: "uint256"}],type: "function"}], contractName: "Test"})
> console.log(sc)
SmartContract {
  model: {
    abi: '[{"constant":true,"name":"myField","outputs":[{"name":"","type":"uint256"}],"type":"function"}]',
    contract_address: '0x0000000071727De22E5e9d8bAF0EdAC6f37dA053',
    contract_name: 'Test',
    is_external: true,
    network_id: 'base-sepolia',
    smart_contract_id: 'c8ef4782-0b4a-41fb-ac85-4891bb4aba5f',
    type: 'custom'
  }
}
> await sc.update({contractName: "Test2"})
SmartContract {
  model: {
    abi: '[{"constant":true,"name":"myField","outputs":[{"name":"","type":"uint256"}],"type":"function"}]',
    contract_address: '0x0000000071727De22E5e9d8bAF0EdAC6f37dA053',
    contract_name: 'Test2',
    is_external: true,
    network_id: 'base-sepolia',
    smart_contract_id: 'c8ef4782-0b4a-41fb-ac85-4891bb4aba5f',
    type: 'custom'
  }
}
> let l = await SmartContract.list()
undefined
> console.log(l.data)
  SmartContract {
    model: {
      abi: '[{"constant":true,"name":"myField","outputs":[{"name":"","type":"uint256"}],"type":"function"}]',
      contract_address: '0x0000000071727de22e5e9d8baf0edac6f37da053',
      contract_name: 'Test2',
      is_external: false,
      network_id: 'base-sepolia',
      smart_contract_id: '',
      type: 'custom'
    }
  }
  ...
]

Qualified Impact

@cb-heimdall
Copy link

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@jianlunz-cb jianlunz-cb changed the base branch from master to v0.13.0 December 19, 2024 01:43
@jianlunz-cb jianlunz-cb changed the title feat: Modify Smart Contract API input and add more tests chore: Modify Smart Contract API input and add more tests Dec 19, 2024
@jianlunz-cb jianlunz-cb changed the title chore: Modify Smart Contract API input and add more tests chore: Optimize Smart Contract API input and add more tests Dec 19, 2024
@jianlunz-cb jianlunz-cb merged commit a50d751 into v0.13.0 Dec 19, 2024
6 checks passed
@jianlunz-cb jianlunz-cb deleted the contract_test branch December 19, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants