Skip to content

Commit

Permalink
chore: big.Int constructor rename
Browse files Browse the repository at this point in the history
NewBigIntFromString -> NewIntFromString
RequireBigIntFromString -> RequireIntFromString
NewBigIntFromUint64 -> NewIntFromUint64
  • Loading branch information
randomshinichi committed Jun 4, 2019
1 parent 5c356e4 commit 0846805
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 70 deletions.
20 changes: 10 additions & 10 deletions aeternity/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,28 @@ var Config = ProfileConfig{
NetworkID: "ae_mainnet",
},
Client: ClientConfig{
BaseGas: *utils.NewBigIntFromUint64(15000),
GasPerByte: *utils.NewBigIntFromUint64(20),
GasPrice: *utils.NewBigIntFromUint64(1000000000),
BaseGas: *utils.NewIntFromUint64(15000),
GasPerByte: *utils.NewIntFromUint64(20),
GasPrice: *utils.NewIntFromUint64(1000000000),
TTL: 500,
Fee: *utils.RequireBigIntFromString("200000000000000"),
Fee: *utils.RequireIntFromString("200000000000000"),
Names: AensConfig{
NameTTL: 500, // absolute block height when the name will expire
ClientTTL: 500, // time in blocks until the name resolver should check again in case the name was updated
PreClaimFee: *utils.RequireBigIntFromString("100000000000000"),
ClaimFee: *utils.RequireBigIntFromString("100000000000000"),
UpdateFee: *utils.RequireBigIntFromString("100000000000000"),
PreClaimFee: *utils.RequireIntFromString("100000000000000"),
ClaimFee: *utils.RequireIntFromString("100000000000000"),
UpdateFee: *utils.RequireIntFromString("100000000000000"),
},
Contracts: ContractConfig{
Gas: *utils.NewBigIntFromUint64(1e9),
GasPrice: *utils.NewBigIntFromUint64(1e9),
Gas: *utils.NewIntFromUint64(1e9),
GasPrice: *utils.NewIntFromUint64(1e9),
Amount: *new(big.Int),
Deposit: 0,
VMVersion: 3,
ABIVersion: 1,
},
Oracles: OracleConfig{
QueryFee: *utils.NewBigIntFromUint64(0),
QueryFee: *utils.NewIntFromUint64(0),
QueryTTLType: 0,
QueryTTLValue: 300,
ResponseTTLType: 0,
Expand Down
2 changes: 1 addition & 1 deletion aeternity/hashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func buildOracleQueryID(sender string, senderNonce uint64, recipient string) (id
}
queryIDBin = append(queryIDBin, senderBin...)

senderNonceBytes := utils.NewBigIntFromUint64(senderNonce).Bytes()
senderNonceBytes := utils.NewIntFromUint64(senderNonce).Bytes()
senderNonceBytesPadded := leftPadByteSlice(32, senderNonceBytes)
queryIDBin = append(queryIDBin, senderNonceBytesPadded...)

Expand Down
2 changes: 1 addition & 1 deletion aeternity/terminal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Test_printIf_BigIntBalancePrinted(t *testing.T) {
name: "Test that printIf() recognizes the big.Int special case",
args: args{
title: "Title",
v: utils.NewBigIntFromUint64(1377),
v: utils.NewIntFromUint64(1377),
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions aeternity/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func calcFeeStd(tx Tx, txLen int) *big.Int {
fee := new(big.Int)
txLenGasPerByte := new(big.Int)

txLenGasPerByte.Mul(utils.NewBigIntFromUint64(uint64(txLen)), &Config.Client.GasPerByte)
txLenGasPerByte.Mul(utils.NewIntFromUint64(uint64(txLen)), &Config.Client.GasPerByte)
fee.Add(&Config.Client.BaseGas, txLenGasPerByte)
fee.Mul(fee, &Config.Client.GasPrice)
return fee
Expand Down Expand Up @@ -911,8 +911,8 @@ type ContractCreateTx struct {
}

func encodeVMABI(VMVersion, ABIVersion uint64) []byte {
vmBytes := utils.NewBigIntFromUint64(VMVersion).Bytes()
abiBytes := utils.NewBigIntFromUint64(ABIVersion).Bytes()
vmBytes := utils.NewIntFromUint64(VMVersion).Bytes()
abiBytes := utils.NewIntFromUint64(ABIVersion).Bytes()
vmAbiBytes := []byte{}
vmAbiBytes = append(vmAbiBytes, vmBytes...)
vmAbiBytes = append(vmAbiBytes, leftPadByteSlice(2, abiBytes)...)
Expand Down
78 changes: 39 additions & 39 deletions aeternity/transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ func TestSpendTx_RLP(t *testing.T) {
fields: fields{
senderID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
recipientID: "ak_Egp9yVdpxmvAfQ7vsXGvpnyfNq71msbdUpkMNYGTeTe8kPL3v",
amount: *utils.NewBigIntFromUint64(10),
fee: *utils.NewBigIntFromUint64(10),
amount: *utils.NewIntFromUint64(10),
fee: *utils.NewIntFromUint64(10),
payload: "Hello World",
ttl: uint64(10),
nonce: uint64(1),
Expand All @@ -53,8 +53,8 @@ func TestSpendTx_RLP(t *testing.T) {
fields: fields{
senderID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
recipientID: "ak_Egp9yVdpxmvAfQ7vsXGvpnyfNq71msbdUpkMNYGTeTe8kPL3v",
amount: *utils.NewBigIntFromUint64(0),
fee: *utils.NewBigIntFromUint64(10),
amount: *utils.NewIntFromUint64(0),
fee: *utils.NewIntFromUint64(10),
payload: "Hello World",
ttl: uint64(10),
nonce: uint64(1),
Expand Down Expand Up @@ -146,7 +146,7 @@ func TestNamePreclaimTx_RLP(t *testing.T) {
fields: fields{
AccountID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
CommitmentID: "cm_2jrPGyFKCEFFrsVvQsUzfnSURV5igr2WxvMR679S5DnuFEjet4", // name: fdsa.test, salt: 12345
Fee: *utils.NewBigIntFromUint64(10),
Fee: *utils.NewIntFromUint64(10),
TTL: uint64(10),
Nonce: uint64(1),
},
Expand Down Expand Up @@ -199,8 +199,8 @@ func TestNameClaimTx_RLP(t *testing.T) {
fields: fields{
AccountID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
Name: "fdsa.test",
NameSalt: *utils.RequireBigIntFromString("9795159241593061970"),
Fee: *utils.NewBigIntFromUint64(10),
NameSalt: *utils.RequireIntFromString("9795159241593061970"),
Fee: *utils.NewIntFromUint64(10),
TTL: uint64(10),
Nonce: uint64(1),
},
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestNameUpdateTx_RLP(t *testing.T) {
Pointers: []string{"ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi"},
NameTTL: uint64(0),
ClientTTL: uint64(6),
Fee: *utils.NewBigIntFromUint64(1),
Fee: *utils.NewIntFromUint64(1),
TTL: 5,
Nonce: 5,
},
Expand All @@ -275,7 +275,7 @@ func TestNameUpdateTx_RLP(t *testing.T) {
Pointers: []string{"ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi", "ak_Egp9yVdpxmvAfQ7vsXGvpnyfNq71msbdUpkMNYGTeTe8kPL3v", "ak_542o93BKHiANzqNaFj6UurrJuDuxU61zCGr9LJCwtTUg34kWt"},
NameTTL: uint64(0),
ClientTTL: uint64(6),
Fee: *utils.NewBigIntFromUint64(1),
Fee: *utils.NewIntFromUint64(1),
TTL: 5,
Nonce: 5,
},
Expand All @@ -290,7 +290,7 @@ func TestNameUpdateTx_RLP(t *testing.T) {
Pointers: []string{"ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi", "ak_Egp9yVdpxmvAfQ7vsXGvpnyfNq71msbdUpkMNYGTeTe8kPL3v", "ak_542o93BKHiANzqNaFj6UurrJuDuxU61zCGr9LJCwtTUg34kWt", "ak_rHQAmJsLKC2u7Tr1htTGYxy2ga71AESM611tjGGfyUJmLbDYP"},
NameTTL: uint64(0),
ClientTTL: uint64(6),
Fee: *utils.NewBigIntFromUint64(1),
Fee: *utils.NewIntFromUint64(1),
TTL: 5,
Nonce: 5,
},
Expand Down Expand Up @@ -347,7 +347,7 @@ func TestNameRevokeTx_RLP(t *testing.T) {
fields: fields{
AccountID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
NameID: "nm_ie148R2qZYBfo1Ek3sZpfTLwBhkkqCRKi2Ce8JJ7yyWVRw2Sb", // fdsa.test
Fee: *utils.NewBigIntFromUint64(1),
Fee: *utils.NewIntFromUint64(1),
TTL: 5,
AccountNonce: 5,
},
Expand Down Expand Up @@ -401,7 +401,7 @@ func TestNameTransferTx_RLP(t *testing.T) {
AccountID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
NameID: "nm_ie148R2qZYBfo1Ek3sZpfTLwBhkkqCRKi2Ce8JJ7yyWVRw2Sb", // fdsa.test
RecipientID: "ak_Egp9yVdpxmvAfQ7vsXGvpnyfNq71msbdUpkMNYGTeTe8kPL3v",
Fee: *utils.NewBigIntFromUint64(1),
Fee: *utils.NewIntFromUint64(1),
TTL: 5,
AccountNonce: 5,
},
Expand Down Expand Up @@ -462,12 +462,12 @@ func TestOracleRegisterTx_RLP(t *testing.T) {
accountNonce: uint64(0),
querySpec: "query Specification",
responseSpec: "response Specification",
queryFee: *utils.NewBigIntFromUint64(0),
queryFee: *utils.NewIntFromUint64(0),
oracleTTLType: uint64(0),
oracleTTLValue: uint64(100),
abiVersion: uint64(0),
vmVersion: uint64(0),
txFee: *utils.NewBigIntFromUint64(0),
txFee: *utils.NewIntFromUint64(0),
txTTL: 500,
},
wantTx: "tx_+FgWAaEBHxOjsIvwAUAGYqaLadh194A87EwIZH9u1dhMeJe9UKMAk3F1ZXJ5IFNwZWNpZmljYXRpb26WcmVzcG9uc2UgU3BlY2lmaWNhdGlvbgAAZACCAfQA5kqYWQ==",
Expand All @@ -485,7 +485,7 @@ func TestOracleRegisterTx_RLP(t *testing.T) {
oracleTTLValue: uint64(100),
abiVersion: uint64(1),
vmVersion: uint64(0),
txFee: *utils.RequireBigIntFromString("200000000000000"),
txFee: *utils.RequireIntFromString("200000000000000"),
txTTL: 500,
},
// from the node's debug endpoint
Expand Down Expand Up @@ -565,7 +565,7 @@ func TestOracleExtendTx_RLP(t *testing.T) {
AccountNonce: 1,
TTLType: 0,
TTLValue: 300,
Fee: *utils.NewBigIntFromUint64(10),
Fee: *utils.NewIntFromUint64(10),
TTL: 0,
},
// from the node's debug endpoint2
Expand Down Expand Up @@ -627,12 +627,12 @@ func TestOracleQueryTx_RLP(t *testing.T) {
AccountNonce: uint64(1),
OracleID: "ok_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
Query: "Are you okay?",
QueryFee: *utils.NewBigIntFromUint64(0),
QueryFee: *utils.NewIntFromUint64(0),
QueryTTLType: 0,
QueryTTLValue: 300,
ResponseTTLType: 0,
ResponseTTLValue: 300,
Fee: *utils.RequireBigIntFromString("200000000000000"),
Fee: *utils.RequireIntFromString("200000000000000"),
TTL: 500,
},
// from the node
Expand Down Expand Up @@ -716,7 +716,7 @@ func TestOracleRespondTx_RLP(t *testing.T) {
Response: "Hello back",
ResponseTTLType: 0,
ResponseTTLValue: 100,
Fee: *utils.RequireBigIntFromString("200000000000000"),
Fee: *utils.RequireIntFromString("200000000000000"),
TTL: 500,
},
wantTx: "tx_+F0YAaEEzqet5HDJ+Z2dTkAIgKhvHUm7REti8Rqeu2S7z+tz/vMBoLT1h6fjQDFn1a7j+6wVQ886V47xiFwvkbL+x2yR3J9cikhlbGxvIGJhY2sAZIa15iD0gACCAfQC7+L+",
Expand Down Expand Up @@ -798,9 +798,9 @@ func TestContractCreateTx_RLP(t *testing.T) {
AbiVersion: uint64(1),
Deposit: 0,
Amount: *new(big.Int),
Gas: *utils.NewBigIntFromUint64(1e9),
GasPrice: *utils.NewBigIntFromUint64(1e9),
Fee: *utils.RequireBigIntFromString("200000000000000"),
Gas: *utils.NewIntFromUint64(1e9),
GasPrice: *utils.NewIntFromUint64(1e9),
Fee: *utils.RequireIntFromString("200000000000000"),
TTL: 500,
CallData: "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACC5yVbyizFJqfWYeqUF89obIgnMVzkjQAYrtsG9n5+Z6gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnHQYrA==",
},
Expand All @@ -818,9 +818,9 @@ func TestContractCreateTx_RLP(t *testing.T) {
AbiVersion: uint64(1),
Deposit: 0,
Amount: *new(big.Int),
Gas: *utils.NewBigIntFromUint64(1e9),
GasPrice: *utils.NewBigIntFromUint64(1e9),
Fee: *utils.RequireBigIntFromString("200000000000000"),
Gas: *utils.NewIntFromUint64(1e9),
GasPrice: *utils.NewIntFromUint64(1e9),
Fee: *utils.RequireIntFromString("200000000000000"),
TTL: 500,
CallData: "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACC5yVbyizFJqfWYeqUF89obIgnMVzkjQAYrtsG9n5+Z6gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnHQYrA==",
},
Expand Down Expand Up @@ -911,9 +911,9 @@ func TestContractCreateTx_FeeEstimate(t *testing.T) {
AbiVersion: 1,
Deposit: 0,
Amount: *new(big.Int),
Gas: *utils.NewBigIntFromUint64(1e9),
GasPrice: *utils.NewBigIntFromUint64(1e9),
Fee: *utils.RequireBigIntFromString("200000000000000"),
Gas: *utils.NewIntFromUint64(1e9),
GasPrice: *utils.NewIntFromUint64(1e9),
Fee: *utils.RequireIntFromString("200000000000000"),
TTL: 500,
CallData: "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBo8mdjOP9QiDmrpHdJ7/qL6H7yhPIH+z2ZmHAc1TiHxQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACo7dbVl",
},
Expand Down Expand Up @@ -976,13 +976,13 @@ func TestContractCallTx_RLP(t *testing.T) {
CallerID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
AccountNonce: uint64(1),
ContractID: "ct_2pfWWzeRzWSdm68HXZJn61KhxdsBA46wzYgvo1swkdJZij1rKm",
Amount: *utils.NewBigIntFromUint64(10),
Gas: *utils.NewBigIntFromUint64(10),
GasPrice: *utils.NewBigIntFromUint64(10),
Amount: *utils.NewIntFromUint64(10),
Gas: *utils.NewIntFromUint64(10),
GasPrice: *utils.NewIntFromUint64(10),
AbiVersion: uint64(3),
VMVersion: uint64(1),
CallData: "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACDiIx1s38k5Ft5Ms6mFe/Zc9A/CVvShSYs/fnyYDBmTRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACo7j+li",
Fee: *utils.RequireBigIntFromString("200000000000000"),
Fee: *utils.RequireIntFromString("200000000000000"),
TTL: 500,
},
wantTx: "tx_+NcrAaEBzqet5HDJ+Z2dTkAIgKhvHUm7REti8Rqeu2S7z+tz/vMBoQXv7ERRuvBfaps6b3yVUqmUUEmGvanaJbGAxkh6t034wwOGteYg9IAAggH0CgoKuIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIOIjHWzfyTkW3kyzqYV79lz0D8JW9KFJiz9+fJgMGZNEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKk9Ku98=",
Expand All @@ -995,12 +995,12 @@ func TestContractCallTx_RLP(t *testing.T) {
AccountNonce: uint64(2),
ContractID: "ct_2pfWWzeRzWSdm68HXZJn61KhxdsBA46wzYgvo1swkdJZij1rKm",
Amount: *new(big.Int),
Gas: *utils.NewBigIntFromUint64(1e9),
GasPrice: *utils.NewBigIntFromUint64(1e9),
Gas: *utils.NewIntFromUint64(1e9),
GasPrice: *utils.NewIntFromUint64(1e9),
AbiVersion: uint64(4),
VMVersion: uint64(1),
CallData: "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACDiIx1s38k5Ft5Ms6mFe/Zc9A/CVvShSYs/fnyYDBmTRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACo7j+li",
Fee: *utils.RequireBigIntFromString("200000000000000"),
Fee: *utils.RequireIntFromString("200000000000000"),
TTL: 500,
},
wantTx: "tx_+N8rAaEBzqet5HDJ+Z2dTkAIgKhvHUm7REti8Rqeu2S7z+tz/vMCoQXv7ERRuvBfaps6b3yVUqmUUEmGvanaJbGAxkh6t034wwSGteYg9IAAggH0AIQ7msoAhDuaygC4gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg4iMdbN/JORbeTLOphXv2XPQPwlb0oUmLP358mAwZk0QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqty+KkQ==",
Expand Down Expand Up @@ -1081,13 +1081,13 @@ func TestContractCallTx_FeeEstimate(t *testing.T) {
CallerID: "ak_2a1j2Mk9YSmC1gioUq4PWRm3bsv887MbuRVwyv4KaUGoR1eiKi",
AccountNonce: uint64(2),
ContractID: "ct_2pfWWzeRzWSdm68HXZJn61KhxdsBA46wzYgvo1swkdJZij1rKm",
Amount: *utils.NewBigIntFromUint64(0),
Gas: *utils.NewBigIntFromUint64(1e5),
GasPrice: *utils.NewBigIntFromUint64(1e9),
Amount: *utils.NewIntFromUint64(0),
Gas: *utils.NewIntFromUint64(1e5),
GasPrice: *utils.NewIntFromUint64(1e9),
AbiVersion: uint64(4),
VMVersion: uint64(1),
CallData: "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACDiIx1s38k5Ft5Ms6mFe/Zc9A/CVvShSYs/fnyYDBmTRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACo7j+li",
Fee: *utils.NewBigIntFromUint64(2e9),
Fee: *utils.NewIntFromUint64(2e9),
TTL: 0,
},
wantErr: false,
Expand Down
4 changes: 2 additions & 2 deletions cmd/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func txSpendFunc(cmd *cobra.Command, args []string) (err error) {
// Load variables from arguments
sender = args[0]
recipient = args[1]
amount, err = utils.NewBigIntFromString(args[2])
feeBigInt, _ = utils.NewBigIntFromString(fee)
amount, err = utils.NewIntFromString(args[2])
feeBigInt, _ = utils.NewIntFromString(fee)

// Validate arguments
if len(sender) == 0 {
Expand Down
4 changes: 2 additions & 2 deletions integration_test/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestContracts(t *testing.T) {

code := "cb_+QP1RgKgpVq1Ib2r2ug+UktHvfWSQ8P35HJQHM6qikqBu1DwgtT5Avv5ASqgaPJnYzj/UIg5q6R3Se/6i+h+8oTyB/s9mZhwHNU4h8WEbWFpbrjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKD//////////////////////////////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+QHLoLnJVvKLMUmp9Zh6pQXz2hsiCcxXOSNABiu2wb2fn5nqhGluaXS4YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////////////7kBQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEA//////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///////////////////////////////////////////uMxiAABkYgAAhJGAgIBRf7nJVvKLMUmp9Zh6pQXz2hsiCcxXOSNABiu2wb2fn5nqFGIAAMBXUIBRf2jyZ2M4/1CIOaukd0nv+ovofvKE8gf7PZmYcBzVOIfFFGIAAK9XUGABGVEAW2AAGVlgIAGQgVJgIJADYAOBUpBZYABRWVJgAFJgAPNbYACAUmAA81tZWWAgAZCBUmAgkANgABlZYCABkIFSYCCQA2ADgVKBUpBWW2AgAVFRWVCAkVBQgJBQkFZbUFCCkVBQYgAAjFaFMi4xLjBJtQib"
callData = "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACC5yVbyizFJqfWYeqUF89obIgnMVzkjQAYrtsG9n5+Z6gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnHQYrA=="
create, err := contractsAlice.ContractCreateTx(code, callData, aeternity.Config.Client.Contracts.VMVersion, aeternity.Config.Client.Contracts.ABIVersion, aeternity.Config.Client.Contracts.Deposit, aeternity.Config.Client.Contracts.Amount, *utils.NewBigIntFromUint64(1e5), aeternity.Config.Client.Contracts.GasPrice, *utils.NewBigIntFromUint64(564480000000000))
create, err := contractsAlice.ContractCreateTx(code, callData, aeternity.Config.Client.Contracts.VMVersion, aeternity.Config.Client.Contracts.ABIVersion, aeternity.Config.Client.Contracts.Deposit, aeternity.Config.Client.Contracts.Amount, *utils.NewIntFromUint64(1e5), aeternity.Config.Client.Contracts.GasPrice, *utils.NewIntFromUint64(564480000000000))
if err != nil {
t.Fatal(err)
}
Expand All @@ -41,7 +41,7 @@ func TestContracts(t *testing.T) {
delay(getContract)

callData = "cb_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBo8mdjOP9QiDmrpHdJ7/qL6H7yhPIH+z2ZmHAc1TiHxQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACo7dbVl"
callTx, err := contractsAlice.ContractCallTx(ctID, callData, aeternity.Config.Client.Contracts.VMVersion, aeternity.Config.Client.Contracts.ABIVersion, aeternity.Config.Client.Contracts.Amount, *utils.NewBigIntFromUint64(1e5), aeternity.Config.Client.Contracts.GasPrice, *utils.NewBigIntFromUint64(665480000000000))
callTx, err := contractsAlice.ContractCallTx(ctID, callData, aeternity.Config.Client.Contracts.VMVersion, aeternity.Config.Client.Contracts.ABIVersion, aeternity.Config.Client.Contracts.Amount, *utils.NewIntFromUint64(1e5), aeternity.Config.Client.Contracts.GasPrice, *utils.NewIntFromUint64(665480000000000))
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion integration_test/oracle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestOracleWorkflow(t *testing.T) {
oracleAlice := aeternity.Oracle{Client: client, Account: alice}

// Register
queryFee := utils.NewBigIntFromUint64(1000)
queryFee := utils.NewIntFromUint64(1000)
register, err := oracleAlice.OracleRegisterTx("hello", "helloback", *queryFee, 0, 100, 0, 0)
if err != nil {
t.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions integration_test/spend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ func TestSpendTx(t *testing.T) {
node := setupNetwork(t)
alice, bob := setupAccounts(t)

amount := utils.RequireBigIntFromString("18446744073709551615") // max uint64
fee := utils.NewBigIntFromUint64(uint64(2e13))
amount := utils.RequireIntFromString("18446744073709551615") // max uint64
fee := utils.NewIntFromUint64(uint64(2e13))
msg := "Hello World"

// In case the recipient account already has funds, get recipient's account info. If it exists, expectedAmount = existing balance + amount + fee
Expand Down

0 comments on commit 0846805

Please sign in to comment.