write(b) {
        const buf = new util_1.default.Reader(b);
        // asset_specific_vote (bool)
        {
            this.asset_specific_vote = bytes_1.read(buf, 'bool');
        }
        // asset_type (string)
        if (this.asset_specific_vote) {
            this.asset_type = bytes_1.ReadFixedChar(buf, 3);
        }
        // asset_code (AssetCode)
        if (this.asset_specific_vote) {
            this.asset_code = new protocol_types_1.AssetCode();
            this.asset_code.Write(buf);
        }
        // specific (bool)
        {
            this.specific = bytes_1.read(buf, 'bool');
        }
        // proposed_amendments ([]Amendment)
        if (this.specific) {
            // IsInternalTypeArray
            const size = bytes_1.ReadVariableSize(buf, 8, 8);
            this.proposed_amendments = [];
            for (let i = 0; i < size; i++) {
                const newValue = new field_types_1.Amendment();
                newValue.Write(buf);
                this.proposed_amendments.push(newValue);
            }
        }
        // vote_tx_id (TxId)
        {
            this.vote_tx_id = new protocol_types_1.TxId();
            this.vote_tx_id.Write(buf);
        }
        // option_tally ([]uint64)
        {
            const size = bytes_1.ReadVariableSize(buf, 8, 8);
            const type = '[]uint64'.slice(2);
            this.option_tally = [...Array(size)].map(() => bytes_1.read(buf, type));
        }
        // result (string)
        {
            this.result = bytes_1.ReadVarChar(buf, 8);
        }
        // timestamp (Timestamp)
        {
            this.timestamp = new protocol_types_1.Timestamp();
            this.timestamp.Write(buf);
        }
        return b.length - buf.length;
    }
// write populates the fields in Result from the byte slice
write populates the fields in Result from the byte slice
write populates the fields in Result from the byte slice
write(b) {
        const buf = new util_1.default.Reader(b);
        {
            this.asset_specific_vote = bytes_1.read(buf, 'bool');
        }
        if (this.asset_specific_vote) {
            this.asset_type = bytes_1.ReadFixedChar(buf, 3);
        }
        if (this.asset_specific_vote) {
            this.asset_code = new protocol_types_1.AssetCode();
            this.asset_code.Write(buf);
        }
        {
            this.specific = bytes_1.read(buf, 'bool');
        }
        if (this.specific) {
            const size = bytes_1.ReadVariableSize(buf, 8, 8);
            this.proposed_amendments = [];
            for (let i = 0; i < size; i++) {
                const newValue = new field_types_1.Amendment();
                newValue.Write(buf);
                this.proposed_amendments.push(newValue);
            }
        }
        {
            this.vote_tx_id = new protocol_types_1.TxId();
            this.vote_tx_id.Write(buf);
        }
        {
            const size = bytes_1.ReadVariableSize(buf, 8, 8);
            const type = '[]uint64'.slice(2);
            this.option_tally = [...Array(size)].map(() => bytes_1.read(buf, type));
        }
        {
            this.result = bytes_1.ReadVarChar(buf, 8);
        }
        {
            this.timestamp = new protocol_types_1.Timestamp();
            this.timestamp.Write(buf);
        }
        return b.length - buf.length;
    }
write ( b ) { const buf = new util_1 . default . Reader ( b ) ; { this . asset_specific_vote = bytes_1 . read ( buf , 'bool' ) ; } if ( this . asset_specific_vote ) { this . asset_type = bytes_1 . ReadFixedChar ( buf , 3 ) ; } if ( this . asset_specific_vote ) { this . asset_code = new protocol_types_1 . AssetCode ( ) ; this . asset_code . Write ( buf ) ; } { this . specific = bytes_1 . read ( buf , 'bool' ) ; } if ( this . specific ) { const size = bytes_1 . ReadVariableSize ( buf , 8 , 8 ) ; this . proposed_amendments = [ ] ; for ( let i = 0 ; i < size ; i ++ ) { const newValue = new field_types_1 . Amendment ( ) ; newValue . Write ( buf ) ; this . proposed_amendments . push ( newValue ) ; } } { this . vote_tx_id = new protocol_types_1 . TxId ( ) ; this . vote_tx_id . Write ( buf ) ; } { const size = bytes_1 . ReadVariableSize ( buf , 8 , 8 ) ; const type = '[]uint64' . slice ( 2 ) ; this . option_tally = [ ... Array ( size ) ] . map ( ( ) => bytes_1 . read ( buf , type ) ) ; } { this . result = bytes_1 . ReadVarChar ( buf , 8 ) ; } { this . timestamp = new protocol_types_1 . Timestamp ( ) ; this . timestamp . Write ( buf ) ; } return b . length - buf . length ; }
write populates the fields in Result from the byte slice
write populates the fields in Result from the byte slice
// asset_specific_vote (bool) // asset_type (string) // asset_code (AssetCode) // specific (bool) // proposed_amendments ([]Amendment) // IsInternalTypeArray // vote_tx_id (TxId) // option_tally ([]uint64) // result (string) // timestamp (Timestamp)