diff --git a/aeternity/helpers.go b/aeternity/helpers.go index 0de8f7e2..049bf130 100644 --- a/aeternity/helpers.go +++ b/aeternity/helpers.go @@ -265,23 +265,23 @@ func (o *Oracle) OracleRespondTx(OracleID string, QueryID string, Response strin // ContractCreateTx returns a transaction for creating a contract on the chain func (c *Contract) ContractCreateTx(Code string, CallData string, VMVersion, AbiVersion uint16, Deposit, Amount, Gas, GasPrice, Fee big.Int) (tx ContractCreateTx, err error) { - ttl, nonce, err := GetTTLNonce(c.Client, c.Account.Address, Config.Client.TTL) + ttl, nonce, err := GetTTLNonce(c.Client, c.Owner, Config.Client.TTL) if err != nil { return ContractCreateTx{}, err } - tx = NewContractCreateTx(c.Account.Address, nonce, Code, VMVersion, AbiVersion, Deposit, Amount, Gas, GasPrice, Fee, ttl, CallData) + tx = NewContractCreateTx(c.Owner, nonce, Code, VMVersion, AbiVersion, Deposit, Amount, Gas, GasPrice, Fee, ttl, CallData) return tx, nil } // ContractCallTx returns a transaction for calling a contract on the chain func (c *Contract) ContractCallTx(ContractID, CallData string, AbiVersion uint16, Amount, Gas, GasPrice, Fee big.Int) (tx ContractCallTx, err error) { - ttl, nonce, err := GetTTLNonce(c.Client, c.Account.Address, Config.Client.TTL) + ttl, nonce, err := GetTTLNonce(c.Client, c.Owner, Config.Client.TTL) if err != nil { return ContractCallTx{}, err } - tx = NewContractCallTx(c.Account.Address, nonce, ContractID, Amount, Gas, GasPrice, AbiVersion, CallData, Fee, ttl) + tx = NewContractCallTx(c.Owner, nonce, ContractID, Amount, Gas, GasPrice, AbiVersion, CallData, Fee, ttl) return tx, nil } diff --git a/aeternity/node.go b/aeternity/node.go index 0ee7d6c3..3d249bf0 100644 --- a/aeternity/node.go +++ b/aeternity/node.go @@ -31,8 +31,7 @@ type Aens struct { type Contract struct { Client *Client Compiler *Compiler - Account *Account - source string + Owner string } // Oracle is a account-specific helper that stores state relevant to oracles diff --git a/integration_test/contract_test.go b/integration_test/contract_test.go index 7ec28fca..44002271 100644 --- a/integration_test/contract_test.go +++ b/integration_test/contract_test.go @@ -11,7 +11,7 @@ import ( func TestContracts(t *testing.T) { alice, _ := setupAccounts(t) aeClient := setupNetwork(t, privatenetURL) - contractsAlice := aeternity.Contract{Client: aeClient, Account: alice} + contractsAlice := aeternity.Contract{Client: aeClient, Owner: alice.Address} var ctID string var callData string