-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Philip-21 <[email protected]>
- Loading branch information
Showing
5 changed files
with
105 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package ethereum | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestCreateWalletFile(t *testing.T) { | ||
dir := "walletdata" | ||
|
||
prefix := "WalletPair" | ||
outputDirectory := dir + "wallet.json" | ||
password := "26371628355334###" | ||
t.Run("TestCreateWalletFile", func(t *testing.T) { | ||
keypair, filename, err := CreateWalletFile(outputDirectory, prefix, password) | ||
if err != nil { | ||
t.Logf("unable to create wallet file %v: ", err) | ||
} | ||
assert.NotNil(t, keypair) | ||
assert.NotNil(t, filename) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package ethereum | ||
|
||
import ( | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestReadTruffleCompiledContract(t *testing.T) { | ||
dir := "testdata" | ||
contracFile := filepath.Join(dir, "truffle.json") | ||
|
||
t.Run("TestTruffleCompilesContract", func(t *testing.T) { | ||
ExpectedContractName := "FireFly_Client" | ||
|
||
compiledContracts, err := ReadTruffleCompiledContract(contracFile) | ||
if err != nil { | ||
t.Logf("unable to read truffle contract : %v", err) | ||
} | ||
contractMap := compiledContracts.Contracts | ||
assert.NotNil(t, compiledContracts) | ||
assert.NotNil(t, contractMap) | ||
|
||
contractName, ok := contractMap[ExpectedContractName] | ||
assert.True(t, ok, "Expected contract '%s' not found", ExpectedContractName) | ||
assert.NotNil(t, contractName) | ||
}) | ||
} | ||
|
||
func TestReadSolCompiledContract(t *testing.T){ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"abi": [ | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"name": "_value", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "setValue", | ||
"outputs": [], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "getValue", | ||
"outputs": [ | ||
{ | ||
"name": "transaction", | ||
"type": "uint256" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": true, | ||
"inputs": [], | ||
"name": "getOwner", | ||
"outputs": [ | ||
{ | ||
"name": "hyperledger_client", | ||
"type": "address" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x60606033445566778899aabbccddeeff00112233445566778899aabbccddeeff", | ||
"contractName": "FireFly_Client" | ||
} |
1 change: 1 addition & 0 deletions
1
...kchain/ethereum/walletdatawallet.json/WalletPair_0c424d6735b5967822c9debc2f1cc6c8081feb1b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"address":"0c424d6735b5967822c9debc2f1cc6c8081feb1b","id":"2f59b024-bfff-460c-956a-89b1075279e3","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"7faf7ebbd2ed1856926ba0ab00d6d427ce8330313406fb6661641bad50ff17ab","cipherparams":{"iv":"7a5f74a730d5dbe72fac1eca14ec0024"},"kdf":"scrypt","mac":"5189f9702c3bb3b55464f59915c828a23f3915b5a5bfb49ce3ea558833eed65e","kdfparams":{"dklen":32,"n":1024,"p":1,"r":8,"salt":"96f8e96fbabb2ed7d69eebc5cd8b91234f0c48edbc3ede7d6be2fd1d968e8d6b"}}} |