Skip to content

Commit

Permalink
Merged in coinplugin/go-metadium (pull request #13)
Browse files Browse the repository at this point in the history
Master

Approved-by: Uh Sado <sadoc@metadium.com>
  • Loading branch information
sadoci committed Nov 28, 2018
2 parents dbce50b + 4360259 commit f4fe1b6
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ rocksdb:
$${GOPATH}/bin/govendor sync -v; \
fi
@cd $(shell pwd)/build/_workspace/src/github.com/ethereum/go-ethereum/vendor/github.com/facebook/rocksdb; \
make static_lib;
make -j24 static_lib;
endif

AWK_CODE=' \
Expand Down
29 changes: 29 additions & 0 deletions metadium/metclient/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,33 @@ func SendContract(ctx context.Context, contract *RemoteContract, method string,
return
}

func SendValue(ctx context.Context, cli *ethclient.Client, from *keystore.Key, to common.Address, amount, gas, _gasPrice int) (hash common.Hash, err error) {
chainId, gasPrice, nonce, err := GetOpportunisticTxParams(
ctx, cli, from.Address, false, true)
if err != nil {
return
}
if _gasPrice > 0 {
gasPrice = big.NewInt(int64(_gasPrice))
}

var tx, stx *types.Transaction
tx = types.NewTransaction(nonce.Uint64(), to, big.NewInt(int64(amount)),
uint64(gas), gasPrice, nil)

signer := types.NewEIP155Signer(chainId)
stx, err = types.SignTx(tx, signer, from.PrivateKey)
if err != nil {
return
}

err = cli.SendTransaction(ctx, stx)
if err != nil {
return
}

hash = stx.Hash()
return
}

// EOF
3 changes: 2 additions & 1 deletion metadium/scripts/solc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ solc --version > /dev/null 2>&1
if [ $? = 0 ]; then
SOLC=solc
else
docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:stable"
# docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:stable"
docker --version > /dev/null 2>&1 && SOLC="docker run -v $(pwd):/tmp --workdir /tmp --rm ethereum/solc:0.4.24"
fi

if [ "$SOLC" = "" ]; then
Expand Down

0 comments on commit f4fe1b6

Please sign in to comment.