Skip to content

Commit

Permalink
sign remark and assetid (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDenver007 authored and erickyan86 committed May 13, 2019
1 parent 04d79b1 commit 7311d31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/fee/transaction_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,31 +182,31 @@ func generateAccount() {
contract_b = common.Name(fmt.Sprintf("contractb%d", nonce))

key := types.MakeKeyPair(privateKey, []uint64{0})
acct := &accountmanager.AccountAction{
acct := &accountmanager.CreateAccountAction{
AccountName: normal_a,
Founder: normal_a,
PublicKey: pubKey_a,
}
b, _ := rlp.EncodeToBytes(acct)
sendTransferTx(types.CreateAccount, adminAccount, accAccount, nonce, assetID, balance, b, []*types.KeyPair{key})

acct = &accountmanager.AccountAction{
acct = &accountmanager.CreateAccountAction{
AccountName: normal_b,
Founder: normal_b,
PublicKey: pubKey_b,
}
b, _ = rlp.EncodeToBytes(acct)
sendTransferTx(types.CreateAccount, adminAccount, accAccount, nonce+1, assetID, balance, b, []*types.KeyPair{key})

acct = &accountmanager.AccountAction{
acct = &accountmanager.CreateAccountAction{
AccountName: contract_a,
Founder: contract_a,
PublicKey: pubKey_c,
}
b, _ = rlp.EncodeToBytes(acct)
sendTransferTx(types.CreateAccount, adminAccount, accAccount, nonce+2, assetID, big.NewInt(1000000000000), b, []*types.KeyPair{key})

acct = &accountmanager.AccountAction{
acct = &accountmanager.CreateAccountAction{
AccountName: contract_b,
Founder: contract_b,
PublicKey: pubKey_c,
Expand Down
2 changes: 2 additions & 0 deletions types/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ func (s Signer) Hash(tx *Transaction) common.Hash {
a.data.GasLimit,
a.data.Amount,
a.data.Payload,
a.data.AssetID,
a.data.Remark,
s.chainID, uint(0), uint(0),
})
actionHashs[i] = hash
Expand Down

0 comments on commit 7311d31

Please sign in to comment.