Skip to content

Commit aa43f39

Browse files
authored
Merge pull request #12 from Sentinel-Bluebuilder/claude/quirky-hofstadter-d0913b
fix(server): serialize MsgShareSubscription.bytes as string
2 parents 07eddf1 + 8861584 commit aa43f39

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

server/src/sentinel.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ type BroadcastResult = { code: number; transactionHash: string; rawLog?: string
2727

2828
// Build MsgShareSubscription manually — the SDK version has a camelCase/snake_case mismatch
2929
// between buildMsgShareSubscription (outputs acc_address) and encodeMsgShareSubscription
30-
// (reads accAddress), plus field 4 wire type bug (varint vs string for cosmossdk.io/math.Int).
30+
// (reads accAddress). Field 4 (bytes) is cosmossdk.io/math.Int and must serialize as a
31+
// length-prefixed string on the wire; passing a JS number causes the encoder to emit
32+
// varint and the chain rejects with a wire-type mismatch.
3133
function buildMsgShareSubscription(opts: {
3234
from: string; id: number; accAddress: string; bytes: number;
3335
}): EncodedMsg {
@@ -38,7 +40,7 @@ function buildMsgShareSubscription(opts: {
3840
id: opts.id,
3941
accAddress: opts.accAddress,
4042
acc_address: opts.accAddress,
41-
bytes: opts.bytes,
43+
bytes: String(opts.bytes),
4244
},
4345
};
4446
}

0 commit comments

Comments
 (0)