@@ -4,8 +4,13 @@ import should from 'should';
4
4
import steem from '../src' ;
5
5
6
6
const username = process . env . STEEM_USERNAME || 'guest123' ;
7
- const password = process . env . STEEM_PASSWORD ;
8
- const activeWif = steem . auth . toWif ( username , password , 'active' ) ;
7
+ const activeWif = '5K4RDXLLjoyvKttRj8jG9utT7GZmM9qNkePT6uRfWxKf19g322R' ;
8
+ const activePub = steem . auth . wifToPublic ( activeWif ) ;
9
+ const testAuth = {
10
+ 'weight_threshold' : 1 ,
11
+ 'account_auths' : [ ] ,
12
+ 'key_auths' : [ [ activePub , 1 ] ]
13
+ } ;
9
14
10
15
describe ( 'steem.smt:' , ( ) => {
11
16
@@ -30,7 +35,7 @@ describe('steem.smt:', () => {
30
35
31
36
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
32
37
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
33
- steem . api . verifyAuthorityAsync ( tx ) . then (
38
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
34
39
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
35
40
( err ) => { done ( err ) ; }
36
41
) ;
@@ -98,7 +103,7 @@ describe('steem.smt:', () => {
98
103
99
104
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
100
105
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
101
- steem . api . verifyAuthorityAsync ( tx ) . then (
106
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
102
107
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
103
108
( err ) => { done ( err ) ; }
104
109
) ;
@@ -141,7 +146,7 @@ describe('steem.smt:', () => {
141
146
142
147
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
143
148
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
144
- steem . api . verifyAuthorityAsync ( tx ) . then (
149
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
145
150
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
146
151
( err ) => { done ( err ) ; }
147
152
) ;
@@ -169,7 +174,7 @@ describe('steem.smt:', () => {
169
174
170
175
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
171
176
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
172
- steem . api . verifyAuthorityAsync ( tx ) . then (
177
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
173
178
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
174
179
( err ) => { done ( err ) ; }
175
180
) ;
@@ -198,7 +203,7 @@ describe('steem.smt:', () => {
198
203
199
204
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
200
205
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
201
- steem . api . verifyAuthorityAsync ( tx ) . then (
206
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
202
207
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
203
208
( err ) => { done ( err ) ; }
204
209
) ;
@@ -224,7 +229,7 @@ describe('steem.smt:', () => {
224
229
225
230
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
226
231
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
227
- steem . api . verifyAuthorityAsync ( tx ) . then (
232
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
228
233
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
229
234
( err ) => { done ( err ) ; }
230
235
) ;
@@ -259,7 +264,7 @@ describe('steem.smt:', () => {
259
264
260
265
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
261
266
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
262
- steem . api . verifyAuthorityAsync ( tx ) . then (
267
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
263
268
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
264
269
( err ) => { done ( err ) ; }
265
270
) ;
@@ -296,7 +301,7 @@ describe('steem.smt:', () => {
296
301
297
302
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
298
303
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
299
- steem . api . verifyAuthorityAsync ( tx ) . then (
304
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
300
305
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
301
306
( err ) => { done ( err ) ; }
302
307
) ;
@@ -325,7 +330,7 @@ describe('steem.smt:', () => {
325
330
326
331
steem . broadcast . _prepareTransaction ( tx ) . then ( function ( tx ) {
327
332
tx = steem . auth . signTransaction ( tx , [ activeWif ] ) ;
328
- steem . api . verifyAuthorityAsync ( tx ) . then (
333
+ steem . api . verifyAuthorityAsync ( tx , testAuth ) . then (
329
334
( result ) => { result . should . equal ( true ) ; done ( ) ; } ,
330
335
( err ) => { done ( err ) ; }
331
336
) ;
0 commit comments