-
Notifications
You must be signed in to change notification settings - Fork 37
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 entrypoints #538
base: feat/next
Are you sure you want to change the base?
Add entrypoints #538
Conversation
chainId = "1"; | ||
} | ||
|
||
export class LocalnetEntrypointConfig implements EntrypointConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
private networkProvider: ApiNetworkProvider | ProxyNetworkProvider; | ||
private chainId: string; | ||
|
||
constructor(networkProviderUrl: string, networkProviderKind: string, chainId: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe using the "options" pattern? 💭
return verifier.verify(txComputer.computeBytesForVerifying(transaction), transaction.signature); | ||
} | ||
|
||
async signMessage(message: Message, account: IAccount): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they will be soon moved to account: multiversx/mx-sdk-specs#94
chainId: string; | ||
} | ||
|
||
export class TestnetEntrypointConfig implements EntrypointConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be easier to have constructors on these classes in case somebody wants to change one of the fields (e.g. networkProviderUrl
) without having to access the fields after the initialization.
this.timeout(30000); | ||
const abi = await loadAbiRegistry("src/testdata/adder.abi.json"); | ||
const sender = Account.newFromPem(alicePem.pemFileText); | ||
const accountAddress = new Address(sender.address.bech32()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's no need to convert the address to bech32 then back to Address
. Can simply be sender.address
.
|
||
const transaction = await controller.createTransactionForDeploy( | ||
sender, | ||
BigInt(sender.getNonceThenIncrement().valueOf()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should switch to bigint
for the nonce instead of INonce
. valueOf
also returns a number
which can lead to errors in the future. can be done in the next PR.
}, | ||
); | ||
|
||
assert.equal((await relayedTransaction).chainID, "D"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also assert on the data
and gasLimit
fields.
No description provided.