Skip to content

Commit

Permalink
fix: rearranged function arguments and correct param types in OracleR…
Browse files Browse the repository at this point in the history
…egisterTx()
  • Loading branch information
randomshinichi committed Mar 23, 2019
1 parent 4c76f06 commit 2b00541
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions aeternity/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func NameUpdateTx(accountID, nameID string, pointers []string, nameTTL, clientTT
}

// OracleRegisterTx register an oracle
func OracleRegisterTx(accountID string, accountNonce uint64, querySpec, responseSpec string, queryFee uint64, ttlType string, ttlValue uint64, fee utils.BigInt, ttl, abiVersion uint64) (rlpRawMsg []byte, err error) {
func OracleRegisterTx(accountID string, accountNonce uint64, querySpec, responseSpec string, queryFee utils.BigInt, oracleTTLType, oracleTTLValue, abiVersion uint64, txFee utils.BigInt, txTTL uint64) (rlpRawMsg []byte, err error) {
// build id for the account
aID, err := buildIDTag(IDTagAccount, accountID)
if err != nil {
Expand All @@ -185,11 +185,11 @@ func OracleRegisterTx(accountID string, accountNonce uint64, querySpec, response
accountNonce,
[]byte(querySpec),
[]byte(responseSpec),
queryFee,
[]byte(ttlType),
ttlValue,
fee.Bytes(),
ttl,
queryFee.Bytes(),
oracleTTLType,
oracleTTLValue,
txFee.Bytes(),
txTTL,
abiVersion)
return
}
Expand Down
3 changes: 2 additions & 1 deletion aeternity/transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import (
func TestOracleRegisterTx(t *testing.T) {
sender := "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi"
fee := utils.NewBigIntFromUint64(100)
txRaw, err := aeternity.OracleRegisterTx(sender, 0, "likethis", "likethat", 123456789, "delta", 1, *fee, 1, 1)
queryFee := utils.NewBigIntFromUint64(123456789)
txRaw, err := aeternity.OracleRegisterTx(sender, 0, "likethis", "likethat", *queryFee, 0, 1, 0, *fee, 1) // "delta/absolute" is represented by an integer
if err != nil {
t.Errorf("Could not create OracleRegisterTx: %s", err)
}
Expand Down

0 comments on commit 2b00541

Please sign in to comment.