Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transferCoins does not work anymore #39

Open
manihagh opened this issue Aug 20, 2019 · 7 comments
Open

transferCoins does not work anymore #39

manihagh opened this issue Aug 20, 2019 · 7 comments

Comments

@manihagh
Copy link

manihagh commented Aug 20, 2019

Just tried the transferCoins example and seems does not work anymore.

LibraTransactionResponse {
signedTransaction: LibraSignedTransaction {
transaction: LibraTransaction {
program: [Object],
gasContraint: [Object],
expirationTime: [BigNumber],
sendersAddress: [AccountAddress],
sequenceNumber: [BigNumber]
},
publicKey: Uint8Array [
126, 142, 165, 73, 194, 136, 153, 77,
213, 61, 211, 220, 2, 180, 195, 48,
128, 186, 113, 104, 203, 53, 60, 113,
224, 54, 74, 205, 207, 172, 13, 60
],
signature: Uint8Array [
220, 207, 1, 86, 178, 236, 48, 138, 181, 91, 106,
88, 206, 56, 244, 57, 205, 75, 11, 128, 153, 75,
131, 223, 121, 86, 171, 73, 149, 72, 123, 214, 43,
157, 175, 199, 127, 108, 6, 30, 178, 143, 220, 214,
65, 137, 141, 43, 137, 213, 238, 231, 103, 27, 125,
197, 32, 14, 113, 135, 229, 120, 95, 9
]
},
validatorId: Uint8Array [],
acStatus: -1,
mempoolStatus: -1,
vmStatus: LibraVMStatusError {
errorType: 1,
validationStatusError: { code: 2, message: 'none' },
verificationStatusErrors: undefined,
invariantViolationError: undefined,
deserializationError: undefined,
executionError: undefined
}
}

@perfectmak
Copy link
Owner

Yes, this has come to my attention recently too, but I'm quite busy this week and won't be able to look into this until weekend.

If you have some time and know what the issue is, I would appreciate your contribution, or else you will have to wait a little while before I can get a fix for it. Thank you for using libra-core.

@manihagh
Copy link
Author

manihagh commented Aug 21, 2019

Thanks, the error indicates error type: 1 ("VALIDATION") and validationStatusError: 2 ( "INVALIDAUTHKEY"). Also looking at LibraTransaction object seems the senders address is not valid:
sendersAddress: AccountAddress {
addressBytes: Uint8Array [
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0
]
}

The issue seems to be be the signed transaction does not contain correct sender address before encoding within execute.

For now, I resolved this by adding below line in 'lib/client/index.ts':
transaction.sendersAddress = sender.getAddress();

After this:
public async execute(transaction: LibraTransaction, sender: Account): Promise<LibraTransactionResponse> {

However, I prefer not create a PR as the root cause could be within lib/transaction

@zoeyTM
Copy link

zoeyTM commented Aug 22, 2019

@manihagh I'm honestly not sure how to reproduce this error. I just tried the transferring libra coins example and it worked for me.

@mmsqe
Copy link

mmsqe commented Aug 23, 2019

transferCoins works but mintWithFaucetService not, seems related to mintAddress change in c5cce92, updated in #40

@totiz
Copy link
Contributor

totiz commented Aug 23, 2019

@mmsqe yes you're right the problem is come from this, I gonna make PR to fix this soon.

@totiz
Copy link
Contributor

totiz commented Aug 23, 2019

@mmsqe Oh you just make a PR, nice!

@totiz
Copy link
Contributor

totiz commented Aug 23, 2019

I suggest to change constant of MinterAddress to AssociationAddress, It'll more clear what the constant represent. Reference to this https://github.com/libra/libra/blob/testnet/types/src/account_config.rs#L49

And kula-libra just update as well https://github.com/kulapio/libra-core/pull/7/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants