Skip to content

Commit

Permalink
fix(contract): don't mark contract as deployed if tx failed
Browse files Browse the repository at this point in the history
To avoid DuplicateContractError if signing was rejected or so.
  • Loading branch information
davidyuk committed Aug 27, 2023
1 parent 139c9d2 commit cc4222d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/contract/Contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ class Contract<M extends ContractMethodsBase> {
code: this.$options.bytecode,
ownerId,
});
this.$options.address = buildContractIdByContractTx(tx);
const { hash, ...other } = await this.#sendAndProcess(
tx,
'init',
{ ...opt, onAccount: opt.onAccount },
);
this.$options.address = buildContractIdByContractTx(tx);
return {
...other,
...other.result?.log != null && {
Expand Down

0 comments on commit cc4222d

Please sign in to comment.