diff --git a/index.ts b/index.ts index 458afa9..42f9f76 100644 --- a/index.ts +++ b/index.ts @@ -233,10 +233,6 @@ export interface TxPayloadTenureChange { cause: TenureChangeCause; /** (Hex string) The ECDSA public key hash of the current tenure */ pubkey_hash: string; - /** (Hex string) A Schnorr signature from at least 70% of the Stackers */ - signature: string; - /** (Hex string) A bitmap of which Stackers signed */ - signers: string; } export enum TenureChangeCause { diff --git a/src/stacks_tx/deserialize.rs b/src/stacks_tx/deserialize.rs index 3cf7572..0f302d6 100644 --- a/src/stacks_tx/deserialize.rs +++ b/src/stacks_tx/deserialize.rs @@ -470,14 +470,6 @@ impl TransactionTenureChange { let mut pubkey_hash = [0u8; 20]; fd.read_exact(&mut pubkey_hash)?; - // ThresholdSignature { R: [0u8; 33], z: [0u8; 32] } - let mut signature = [0u8; 65]; - fd.read_exact(&mut signature)?; - - let signers_len: u32 = fd.read_u32::()?; - let mut signers: Vec = vec![0u8; signers_len as usize]; - fd.read_exact(&mut signers)?; - Ok(TransactionTenureChange { tenure_consensus_hash, prev_tenure_consensus_hash, @@ -486,8 +478,6 @@ impl TransactionTenureChange { previous_tenure_blocks, cause, pubkey_hash, - signature, - signers, }) } } @@ -729,8 +719,6 @@ pub struct TransactionTenureChange { pub previous_tenure_blocks: u32, pub cause: TenureChangeCause, pub pubkey_hash: [u8; 20], - pub signature: [u8; 65], - pub signers: Vec, } #[repr(u8)] @@ -807,7 +795,7 @@ mod tests { // tx prefix (before payload): // let input = b"00000000010400982f3ec112a5f5928a5c96a914bd733793b896a5000000000000053000000000000002290000c85889dad0d5b08a997a93a28a7c93eb22c324e5f8992dc93e37865ef4f3e0d65383beefeffc4871a2facbc4b590ddf887c80de6638ed4e2ec0e633d1e130f23030100000000"; - let input = b"808000000004001dc27eba0247f8cc9575e7d45e50a0bc7e72427d000000000000001d000000000000000000011dc72b6dfd9b36e414a2709e3b01eb5bbdd158f9bc77cd2ca6c3c8b0c803613e2189f6dacf709b34e8182e99d3a1af15812b75e59357d9c255c772695998665f010200000000076f2ff2c4517ab683bf2d588727f09603cc3e9328b9c500e21a939ead57c0560af8a3a132bd7d56566f2ff2c4517ab683bf2d588727f09603cc3e932828dcefb98f6b221eef731cabec7538314441c1e0ff06b44c22085d41aae447c1000000010014ff3cb19986645fd7e71282ad9fea07d540a60e0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798000000000000000000000000000000000000000000000000000000000000000000000000"; + let input = b"808000000004001dc27eba0247f8cc9575e7d45e50a0bc7e72427d000000000000001d000000000000000000011dc72b6dfd9b36e414a2709e3b01eb5bbdd158f9bc77cd2ca6c3c8b0c803613e2189f6dacf709b34e8182e99d3a1af15812b75e59357d9c255c772695998665f010200000000076f2ff2c4517ab683bf2d588727f09603cc3e9328b9c500e21a939ead57c0560af8a3a132bd7d56566f2ff2c4517ab683bf2d588727f09603cc3e932828dcefb98f6b221eef731cabec7538314441c1e0ff06b44c22085d41aae447c1000000010014ff3cb19986645fd7e71282ad9fea07d540a60e"; let bytes = decode_hex(input).unwrap(); let bytes_len = bytes.len(); diff --git a/src/stacks_tx/neon_encoder.rs b/src/stacks_tx/neon_encoder.rs index 1f08823..a916f20 100644 --- a/src/stacks_tx/neon_encoder.rs +++ b/src/stacks_tx/neon_encoder.rs @@ -682,12 +682,6 @@ impl NeonJsSerialize for TransactionTenureChange { let pubkey_hash = cx.string(encode_hex(&self.pubkey_hash)); obj.set(cx, "pubkey_hash", pubkey_hash)?; - let signature = cx.string(encode_hex(&self.signature)); - obj.set(cx, "signature", signature)?; - - let signers = cx.string(encode_hex(&self.signers)); - obj.set(cx, "signers", signers)?; - Ok(()) } } diff --git a/tests/tx-decode-3.0.test.ts b/tests/tx-decode-3.0.test.ts index 361afd1..7cc10f2 100644 --- a/tests/tx-decode-3.0.test.ts +++ b/tests/tx-decode-3.0.test.ts @@ -12,10 +12,10 @@ import { } from '../index.js'; test('stacks3.0 - decode tx - tenure change', () => { - const tenureChangeTx = '808000000004001dc27eba0247f8cc9575e7d45e50a0bc7e72427d000000000000001d000000000000000000011dc72b6dfd9b36e414a2709e3b01eb5bbdd158f9bc77cd2ca6c3c8b0c803613e2189f6dacf709b34e8182e99d3a1af15812b75e59357d9c255c772695998665f010200000000076f2ff2c4517ab683bf2d588727f09603cc3e9328b9c500e21a939ead57c0560af8a3a132bd7d56566f2ff2c4517ab683bf2d588727f09603cc3e932828dcefb98f6b221eef731cabec7538314441c1e0ff06b44c22085d41aae447c1000000010014ff3cb19986645fd7e71282ad9fea07d540a60e0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798000000000000000000000000000000000000000000000000000000000000000000000000'; + const tenureChangeTx = '808000000004001dc27eba0247f8cc9575e7d45e50a0bc7e72427d000000000000001d000000000000000000011dc72b6dfd9b36e414a2709e3b01eb5bbdd158f9bc77cd2ca6c3c8b0c803613e2189f6dacf709b34e8182e99d3a1af15812b75e59357d9c255c772695998665f010200000000076f2ff2c4517ab683bf2d588727f09603cc3e9328b9c500e21a939ead57c0560af8a3a132bd7d56566f2ff2c4517ab683bf2d588727f09603cc3e932828dcefb98f6b221eef731cabec7538314441c1e0ff06b44c22085d41aae447c1000000010014ff3cb19986645fd7e71282ad9fea07d540a60e'; const decoded = decodeTransaction(tenureChangeTx); expect(decoded).toEqual({ - "tx_id": "0xc8d48b288a780bc98602c1ed137f80d8bf4a6c60fb50cc569bee33ee7563501b", + "tx_id": "0xd443c1edb6bbcbdb702884a688b3ed09cc2d81e391f09c4d91ac881806979620", "version": TransactionVersion.Testnet, "chain_id": 0x80000000, "auth": { @@ -46,8 +46,6 @@ test('stacks3.0 - decode tx - tenure change', () => { "previous_tenure_blocks": 1, "cause": TenureChangeCause.BlockFound, "pubkey_hash": "0x14ff3cb19986645fd7e71282ad9fea07d540a60e", - "signature": "0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817980000000000000000000000000000000000000000000000000000000000000000", - "signers": "0x" } }); });