mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-14 16:03:45 +00:00
Merge branch 'ethereum:master' into gethintegration
This commit is contained in:
commit
01c41acb7a
2 changed files with 9 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ It enables usecases like the following:
|
||||||
* I want to auto-approve transactions with contract `CasinoDapp`, with up to `0.05 ether` in value to maximum `1 ether` per 24h period
|
* I want to auto-approve transactions with contract `CasinoDapp`, with up to `0.05 ether` in value to maximum `1 ether` per 24h period
|
||||||
* I want to auto-approve transaction to contract `EthAlarmClock` with `data`=`0xdeadbeef`, if `value=0`, `gas < 44k` and `gasPrice < 40Gwei`
|
* I want to auto-approve transaction to contract `EthAlarmClock` with `data`=`0xdeadbeef`, if `value=0`, `gas < 44k` and `gasPrice < 40Gwei`
|
||||||
|
|
||||||
The two main features that are required for this to work well are;
|
The two main features that are required for this to work well are:
|
||||||
|
|
||||||
1. Rule Implementation: how to create, manage, and interpret rules in a flexible but secure manner
|
1. Rule Implementation: how to create, manage, and interpret rules in a flexible but secure manner
|
||||||
2. Credential management and credentials; how to provide auto-unlock without exposing keys unnecessarily.
|
2. Credential management and credentials; how to provide auto-unlock without exposing keys unnecessarily.
|
||||||
|
|
@ -29,10 +29,10 @@ function asBig(str) {
|
||||||
|
|
||||||
// Approve transactions to a certain contract if the value is below a certain limit
|
// Approve transactions to a certain contract if the value is below a certain limit
|
||||||
function ApproveTx(req) {
|
function ApproveTx(req) {
|
||||||
var limit = big.Newint("0xb1a2bc2ec50000")
|
var limit = new BigNumber("0xb1a2bc2ec50000")
|
||||||
var value = asBig(req.transaction.value);
|
var value = asBig(req.transaction.value);
|
||||||
|
|
||||||
if (req.transaction.to.toLowerCase() == "0xae967917c465db8578ca9024c205720b1a3651a9") && value.lt(limit)) {
|
if (req.transaction.to.toLowerCase() == "0xae967917c465db8578ca9024c205720b1a3651a9" && value.lt(limit)) {
|
||||||
return "Approve"
|
return "Approve"
|
||||||
}
|
}
|
||||||
// If we return "Reject", it will be rejected.
|
// If we return "Reject", it will be rejected.
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,12 @@ func (t *tester) generate(parent common.Hash) (common.Hash, *trienode.MergedNode
|
||||||
dirties = make(map[common.Hash]struct{})
|
dirties = make(map[common.Hash]struct{})
|
||||||
)
|
)
|
||||||
for i := 0; i < 20; i++ {
|
for i := 0; i < 20; i++ {
|
||||||
switch rand.Intn(opLen) {
|
// Start with account creation always
|
||||||
|
op := createAccountOp
|
||||||
|
if i > 0 {
|
||||||
|
op = rand.Intn(opLen)
|
||||||
|
}
|
||||||
|
switch op {
|
||||||
case createAccountOp:
|
case createAccountOp:
|
||||||
// account creation
|
// account creation
|
||||||
addr := testrand.Address()
|
addr := testrand.Address()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue