From b2f1305bffb39d3b97f4a3687d59748d28fafff7 Mon Sep 17 00:00:00 2001 From: "mavis.tan" Date: Thu, 22 Aug 2019 19:09:44 +0800 Subject: [PATCH 1/2] bring transfer test back due to broken mint service * related to isDefault check of senderAddress in encode transaction * this change should have been included in https://github.com/perfectmak/libra-core/commit/c5cce923cb3e076341cff5e1ac83069b29628d73 --- lib/transaction/Transactions.ts | 2 +- test/client.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transaction/Transactions.ts b/lib/transaction/Transactions.ts index ca66373..01e2251 100644 --- a/lib/transaction/Transactions.ts +++ b/lib/transaction/Transactions.ts @@ -54,7 +54,7 @@ export class LibraTransaction { maxGasAmount: new BigNumber(1000000), }, `${Math.floor(new Date().getTime() / 1000) + 100}`, - new Uint8Array(Addresses.AddressLength), + new Uint8Array(Buffer.from(Addresses.MinterAddress, 'hex')), '-1', ); } diff --git a/test/client.test.ts b/test/client.test.ts index 331aa5a..6ee9bb1 100644 --- a/test/client.test.ts +++ b/test/client.test.ts @@ -2,7 +2,7 @@ import { LibraAdmissionControlStatus, LibraClient, LibraNetwork, LibraWallet } f import './utils'; describe('LibraClient', () => { - xit('should query account state and transfer', async () => { + it('should query account state and transfer', async () => { const client = new LibraClient({ network: LibraNetwork.Testnet }); const wallet = new LibraWallet({ mnemonic: From 8bc71a49f0235f9e436f8db6bfa41d5217902aaf Mon Sep 17 00:00:00 2001 From: "mavis.tan" Date: Fri, 23 Aug 2019 16:35:13 +0800 Subject: [PATCH 2/2] rename minter to association address to be consistent with below: https://github.com/libra/libra/blob/171a766095954ff6eecf7147a4847b3c3590cdae/types/src/account_config.rs#L49 --- lib/constants/Addresses.ts | 2 +- lib/transaction/Transactions.ts | 2 +- lib/wallet/Accounts.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/constants/Addresses.ts b/lib/constants/Addresses.ts index 9b26fb6..0115da1 100644 --- a/lib/constants/Addresses.ts +++ b/lib/constants/Addresses.ts @@ -1,4 +1,4 @@ export default { AddressLength: 32, - MinterAddress: '000000000000000000000000000000000000000000000000000000000a550c18', + AssociationAddress: '000000000000000000000000000000000000000000000000000000000a550c18', }; diff --git a/lib/transaction/Transactions.ts b/lib/transaction/Transactions.ts index 01e2251..9a3624b 100644 --- a/lib/transaction/Transactions.ts +++ b/lib/transaction/Transactions.ts @@ -54,7 +54,7 @@ export class LibraTransaction { maxGasAmount: new BigNumber(1000000), }, `${Math.floor(new Date().getTime() / 1000) + 100}`, - new Uint8Array(Buffer.from(Addresses.MinterAddress, 'hex')), + new Uint8Array(Buffer.from(Addresses.AssociationAddress, 'hex')), '-1', ); } diff --git a/lib/wallet/Accounts.ts b/lib/wallet/Accounts.ts index fcb2231..eef37df 100644 --- a/lib/wallet/Accounts.ts +++ b/lib/wallet/Accounts.ts @@ -115,7 +115,7 @@ export class AccountAddress { } public static default(): AccountAddress { - return new AccountAddress(new Uint8Array(Buffer.from(Addresses.MinterAddress, 'hex'))); + return new AccountAddress(new Uint8Array(Buffer.from(Addresses.AssociationAddress, 'hex'))); } private readonly addressBytes: Uint8Array;