chore(contract):fix contract.wallet

staking
neeboo 5 years ago
parent 05b80b39bd
commit b3f67fbece
  1. 4
      README.md
  2. 31
      packages/harmony-contract/src/methods/method.ts

@ -138,8 +138,8 @@ async function crossShard() {
await acc1.updateBalances();
await acc2.updateBalances();
// to get sharded address, the format goes `bech32_{shardID}`
// 获得分片地址,返回格式为 `bech32_{shardID}`
// to get sharded address, the format goes `bech32-{shardID}`
// 获得分片地址,返回格式为 `bech32-{shardID}`
const from = acc1.getAddressFromShardID(0);
const to = acc2.getAddressFromShardID(1);

@ -189,22 +189,21 @@ export class ContractMethod {
protected async signTransaction(updateNonce: boolean) {
try {
let signed;
signed =
this.wallet instanceof Wallet
? await this.wallet.signTransaction(
this.transaction,
this.wallet.signer,
undefined,
updateNonce,
'rlp',
'latest', // 'pending',
)
: await this.wallet.signTransaction(
this.transaction,
updateNonce,
'rlp',
'latest', // 'pending',
);
signed = this.wallet.signer
? await this.wallet.signTransaction(
this.transaction,
this.wallet.signer,
undefined,
updateNonce,
'rlp',
'latest', // 'pending',
)
: await this.wallet.signTransaction(
this.transaction,
updateNonce,
'rlp',
'latest', // 'pending',
);
this.contract.address = TransactionFactory.getContractAddress(signed);
this.contract.setStatus(ContractStatus.SIGNED);
return signed;

Loading…
Cancel
Save