@@ -106,4 +106,48 @@ describe('TransferTransaction', () => {
106106 ) ) . to . be . equal ( '9151776168D24257D8000000000000000000000000000000000D000100746573742D6D657373616765' +
107107 '44B262C46CEABB8500E1F50500000000' ) ;
108108 } ) ;
109+
110+ it ( 'should format TransferTransaction payload with 25 bytes binary address' , ( ) => {
111+ const transferTransaction = TransferTransaction . create (
112+ Deadline . create ( ) ,
113+ Address . createFromRawAddress ( 'SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC' ) ,
114+ [
115+ NetworkCurrencyMosaic . createRelative ( 100 ) ,
116+ ] ,
117+ PlainMessage . create ( 'test-message' ) ,
118+ NetworkType . MIJIN_TEST ,
119+ ) ;
120+
121+ // test recipientToString with Address recipient
122+ expect ( transferTransaction . recipientToString ( ) ) . to . be . equal ( 'SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC' ) ;
123+
124+ const signedTransaction = transferTransaction . signWith ( account ) ;
125+
126+ expect ( signedTransaction . payload . substring (
127+ 240 ,
128+ 290 ,
129+ ) ) . to . be . equal ( '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142' ) ;
130+ } ) ;
131+
132+ it ( 'should format TransferTransaction payload with 8 bytes binary namespaceId' , ( ) => {
133+ const transferTransaction = TransferTransaction . create (
134+ Deadline . create ( ) ,
135+ new NamespaceId ( 'nem.owner' ) ,
136+ [
137+ NetworkCurrencyMosaic . createRelative ( 100 ) ,
138+ ] ,
139+ PlainMessage . create ( 'test-message' ) ,
140+ NetworkType . MIJIN_TEST ,
141+ ) ;
142+
143+ // test recipientToString with NamespaceId recipient
144+ expect ( transferTransaction . recipientToString ( ) ) . to . be . equal ( 'd85742d268617751' ) ;
145+
146+ const signedTransaction = transferTransaction . signWith ( account ) ;
147+
148+ expect ( signedTransaction . payload . substring (
149+ 240 ,
150+ 290 ,
151+ ) ) . to . be . equal ( '9151776168D24257D800000000000000000000000000000000' ) ;
152+ } ) ;
109153} ) ;
0 commit comments