Skip to content

Commit

Permalink
[tests] fixed api test
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Lenz committed Sep 28, 2018
1 parent 452f71d commit c7a865c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
5 changes: 3 additions & 2 deletions api/dapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ func (a *DAppApi) SendEthereumTransaction(value, to, data string) (string, error
objTx := map[string]interface{}{
"nonce": ethTx.Nonce,
"gasPrice": ethTx.GasPrice,
"gas": ethTx.GasLimit,
"gasLimit": ethTx.GasLimit,
"to": ethTx.To,
"value": ethTx.Value,
"input": ethTx.Data,
"data": ethTx.Data,
"v": ethTx.V,
"r": ethTx.R,
"s": ethTx.S,
"from": ethTx.From,
"hash": ethTx.Hash,
"chainId": ethTx.ChainID,
}

raw, err := json.Marshal(objTx)
Expand Down
8 changes: 4 additions & 4 deletions bip32/bip32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ func TestKeyDerivation(t *testing.T) {

//Test vector set one
testVectorErrorMapping := map[string]int{
"m/0H/1": 1,
"m/0H/1/2H": 1,
"m/0H/1/2H/2": 1,
"m/0H/1/2H/2/1000000000": 1,
"m/0H/1": 1,
"m/0H/1/2H": 1,
"m/0H/1/2H/2": 1,
"m/0H/1/2H/2/1000000000": 1,
"m/0": 0,
"m/0/2147483647H": 0,
"m/0/2147483647H/1": 0,
Expand Down
1 change: 0 additions & 1 deletion db/bolt_to_storm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"time"


aes "github.com/Bit-Nation/panthalassa/crypto/aes"
keyManager "github.com/Bit-Nation/panthalassa/keyManager"
queue "github.com/Bit-Nation/panthalassa/queue"
Expand Down
9 changes: 4 additions & 5 deletions documents/call.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,23 +226,22 @@ func (d *DocumentSubmitCall) Handle(data map[string]interface{}) (map[string]int
if err := d.s.db.One("ID", int(docID), &doc); err != nil {
return map[string]interface{}{}, err
}

// decrypt document content
docContent, err := d.km.AESDecrypt(doc.EncryptedContent)
if err != nil {
return map[string]interface{}{}, err
}

// assign plain document content
doc.Content = docContent



// hash document
docHash, err := mh.Sum(doc.Content, mh.SHA2_256, -1)
if err != nil {
return map[string]interface{}{}, err
}

docContentCID := cid.NewCidV1(cid.Raw, docHash).Bytes()

// attach cid to document
Expand Down
2 changes: 1 addition & 1 deletion keyManager/keyManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (km KeyManager) SignEthTx(signer types.Signer, addresses common.Address, tx
}

// convert gas
txMap["gas"], err = numToHex(txMap, "gas")
txMap["gas"], err = numToHex(txMap, "gasLimit")
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c7a865c

Please sign in to comment.