Skip to content

Commit a7accad

Browse files
authored
[xc-governance-sdk] Add cosmwasm upgrade ix (#514)
* [xc-governance-sdk] Add cosmwasm upgrade ix * Format the file
1 parent 7202b93 commit a7accad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

governance/xc-governance-sdk-js/src/instructions.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ export class EthereumUpgradeContractInstruction extends TargetInstruction {
120120
}
121121
}
122122

123+
export class CosmwasmUpgradeContractInstruction extends TargetInstruction {
124+
constructor(targetChainId: ChainId, private codeId: bigint) {
125+
super(TargetAction.UpgradeContract, targetChainId);
126+
}
127+
128+
protected serializePayload(): Buffer {
129+
return new BufferBuilder().addBigUint64(this.codeId).build();
130+
}
131+
}
132+
123133
export class AuthorizeGovernanceDataSourceTransferInstruction extends TargetInstruction {
124134
constructor(targetChainId: ChainId, private claimVaa: Buffer) {
125135
super(TargetAction.AuthorizeGovernanceDataSourceTransfer, targetChainId);

0 commit comments

Comments
 (0)