@fioprotocol/fiosdk
Version:
The Foundation for Interwallet Operability (FIO) is a consortium of leading blockchain wallets, exchanges and payments providers that seeks to accelerate blockchain adoption by reducing the risk, complexity, and inconvenience of sending and receiving cryp
38 lines (34 loc) • 1.01 kB
text/typescript
import { expect } from 'chai';
import { Account, Action, FIOSDK, TransactionResponse } from '../../src/FIOSDK';
import { defaultFee } from '../constants';
export const VoteBlockProducerTests = ({
fioSdk,
publicKey,
proxyTpId,
testFioAddressName
}: {
fioSdk: FIOSDK,
publicKey: string,
proxyTpId: string,
testFioAddressName: string
}) => describe('Testing vote block producer', () => {
it(`fioSdk votes for Block Producer`, async () => {
const accountName = FIOSDK.accountHash(publicKey).accountnm
try {
const result = await fioSdk.genericAction('pushTransaction', {
account: Account.eosio,
action: Action.voteProducer,
data: {
actor: accountName,
fio_address: testFioAddressName,
max_fee: defaultFee,
producers: [proxyTpId],
},
}) as TransactionResponse
expect(result.status).to.equal('OK')
} catch (err) {
console.log('Error: ', err)
expect(err).to.equal('null')
}
})
});