Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxianming committed Aug 10, 2018
1 parent 4fdf460 commit a4356c6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions chains/iris/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ TxType.BEGINUNBOND = "beginUnbond";
TxType.COMPLETEUNBOND = "completeUnbond";

class IrisNetConfig{}

IrisNetConfig.MAXGAS = 20000000;
IrisNetConfig.PREFIX_BECH32_ACCADDR = "faa";
IrisNetConfig.PREFIX_BECH32_VALADDR = "fva";
Expand All @@ -15,7 +14,6 @@ IrisNetConfig.ENCODING_BECH32 = "bech32";
IrisNetConfig.ENCODING_HEX = "hex";
IrisNetConfig.DEFAULT_ENCODING = IrisNetConfig.ENCODING_BECH32;


class AminoKey {}
AminoKey.BIP44Prefix = "44'/118'/";
AminoKey.FullFundraiserPath = AminoKey.BIP44Prefix + "0'/0/0";
Expand Down
2 changes: 0 additions & 2 deletions chains/iris/iris_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ class IrisBuilder extends Builder {
* @returns {StdTx}
*/
signTx(tx,privateKey) {

let signMsg = tx;
let sig = signMsg.signByte;
let signbyte = IrisKeypair.sign(privateKey, sig);

let keypair = IrisKeypair.import(privateKey);
let signs = [Bank.NewStdSignature(Codec.Hex.hexToBytes(keypair.publicKey), signbyte, signMsg.accnum, signMsg.sequence)];
let stdTx = Bank.NewStdTx(signMsg.msgs, signMsg.fee, signs, signMsg.memo);
Expand Down
10 changes: 0 additions & 10 deletions test/crypto_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ describe('CryPto test', function () {
});

it('bech32', function () {

console.log(Codec.Bech32.fromBech32("faa1cmjnj9zw0m4aau95dsmzj7zgaqagptzywu3v8r"));
console.log(Codec.Bech32.toBech32("faa","8698502387267CD39EB03D824CEAA6D68539B507"));

});

it('test import', function () {
Expand Down Expand Up @@ -74,23 +72,17 @@ describe('CryPto test', function () {
//冷钱包
it('test buildTx and signTx', function () {
let tx = new blockChainThriftModel.Tx({

"sequence":5,

"ext":0,
"sender":{
"chain":"fuxi-1001",
"app":"v0.2.0",

"addr":"faa1a89us8tvt3d9qpq7j6p06dc3z88n576shj8k2h"

},
"receiver":{
"chain":"fuxi-1001",
"app":"v0.2.0",

"addr":"faa1s6v9qgu8ye7d884s8kpye64x66znndg8t6eztj"

},
"amount":[new blockChainThriftModel.Coin({denom: "iris",amount: 10})],
"fee":new blockChainThriftModel.Fee({denom: "iris",amount: 0}),
Expand All @@ -99,9 +91,7 @@ describe('CryPto test', function () {

let builder = Irisnet.getBuilder(Irisnet.Constants.COMM.Chains.IRIS);
let signMsg = builder.buildTx(tx);

let stdTx = builder.signTx(signMsg,"8789EB2C2510D8D236EB85DAEFE4E1A4EA7D8E6929E0A1400FCF2848CF7F2DA4");

console.log(JSON.stringify(stdTx))
//TODO 将stdTx提交到iris-hub[/tx/send]
});
Expand Down

0 comments on commit a4356c6

Please sign in to comment.