Skip to content

Commit

Permalink
tx/compute: code_hash.replace("0x", "") -> replace(/^0x/, "")
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Jul 2, 2023
1 parent b3a0a34 commit 4516ace
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tx/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class MsgInstantiateContract implements Msg {
this.admin = admin ?? "";

if (code_hash) {
this.codeHash = code_hash.replace("0x", "").toLowerCase();
this.codeHash = code_hash.replace(/^0x/, "").toLowerCase();
} else {
// codeHash will be set in SecretNetworkClient before invoking toProto() & toAimno()
this.codeHash = "";
Expand Down Expand Up @@ -182,7 +182,7 @@ export class MsgExecuteContract<T extends object> implements Msg {
this.sentFunds = sentFunds ?? [];

if (codeHash) {
this.codeHash = codeHash.replace("0x", "").toLowerCase();
this.codeHash = codeHash.replace(/^0x/, "").toLowerCase();
} else {
// codeHash will be set in SecretNetworkClient before invoking toProto() & toAimno()
this.codeHash = "";
Expand Down Expand Up @@ -365,7 +365,7 @@ export class MsgMigrateContract<T extends object> implements Msg {
this.codeId = String(codeId);

if (codeHash) {
this.codeHash = codeHash.replace("0x", "").toLowerCase();
this.codeHash = codeHash.replace(/^0x/, "").toLowerCase();
} else {
// codeHash will be set in SecretNetworkClient before invoking toProto() & toAimno()
this.codeHash = "";
Expand Down

0 comments on commit 4516ace

Please sign in to comment.