Exemple #1
0
def change_active_key():
    key = 'EOS8muoEdY4L9WRYXYB55WmEzYw9A314fW1uMPUqUrFUBMMjWNpxd'
    auth = eosapi.pack_updateauth('test', 'active', 'owner', key, 0)
    act = [N('eosio'), N('updateauth'), [[N('test'), N('active')]], auth]
    r = eosapi.push_transactions2([[act]])
    assert r
    eosapi.produce_block()
Exemple #2
0
def change_owner_key():
    '''
    struct updateauth {
    account_name                      account;
    permission_name                   permission;
    permission_name                   parent;
    authority                         data;
    uint32_t                          delay;
   '''
    key = 'EOS8muoEdY4L9WRYXYB55WmEzYw9A314fW1uMPUqUrFUBMMjWNpxd'
    auth = eosapi.pack_updateauth('hello', 'owner', '', key, 0)
    act = [N('eosio'), N('updateauth'), [[N('hello'), N('owner')]], auth]
    r = eosapi.push_transactions2([[act]])
    assert r
    eosapi.produce_block()
Exemple #3
0
def create_multisig_account():
    #PW5KKNC8zM2KVLrb1cw4YNXZ69NLK7Fr5B35wHmsPt35tyiYkY4RR
    test_keys = {
        'EOS8mqCBdG8yiaULU3YyiD1ZhySzt64KjNb1gQiy4GdUPMEQMxVJJ': '5KZB2UCfpD3qCEUviXrgMdwDb6TDpuvuWvZKH85u9mBYK85Rqzd', 
        'EOS8mrwBdRz1zyaBiMexqJw6UybR9gNLzBC1tdLqqcfVdA2TFcgAb': '5KM6MvhsNRUtafGCghEYWXYXqWidaGTKqfsida6h5mNg5ouQUTv', 
        'EOS8mqgm5kx88XzsxsAAKH5vnq1vGNcSZDfJyar17FnTm1HvBRuXi': '5JiwrohmpRR3PjUcf6NpSLBE2QdAUTJZf1tAHYvK7iAUTWnaGgZ',
        'EOS8msM7326VykwCSdEXZrj8U3goUPYWZ84KxBTy6GajGkpQCXQNX': '5K6HPpxgq5qFkRpUcaVdZVr4hmT61EzU1AFEfkm428pEQP59neB',
    }
    all_keys = wallet.list_keys()
    for pub in test_keys:
        priv = test_keys[pub]
        if not pub in all_keys:
            wallet.import_key('mywallet', priv)
    keys = [
            [
                initeos.key1, 
                initeos.key2
            ],
            [
                'EOS8mqCBdG8yiaULU3YyiD1ZhySzt64KjNb1gQiy4GdUPMEQMxVJJ',
                'EOS8mrwBdRz1zyaBiMexqJw6UybR9gNLzBC1tdLqqcfVdA2TFcgAb'
            ],
            [
                 'EOS8mqgm5kx88XzsxsAAKH5vnq1vGNcSZDfJyar17FnTm1HvBRuXi', 
                 'EOS8msM7326VykwCSdEXZrj8U3goUPYWZ84KxBTy6GajGkpQCXQNX'
            ]
        ]
    accounts = ['test', 'test1', 'test2']
    index = 0
    for key in keys:
        a = accounts[index]
        if not eosapi.get_account(a):
            eosapi.create_account('eosio', a, key[0], key[1])
        index += 1

    eosapi.produce_block()
#"test2" must come first to satisfy the tricky verifycation in authority.hpp:validate
    per = '{"threshold" : 100, "keys" : [], "accounts" : [{"permission":{"actor":"test2","permission":"active"},"weight":50},{"permission":{"actor":"test1","permission":"active"},"weight":50}]}'
#    key = 'EOS8muoEdY4L9WRYXYB55WmEzYw9A314fW1uMPUqUrFUBMMjWNpxd'
    auth = eosapi.pack_updateauth('test', 'active', 'owner', per, 0)
    act = [N('eosio'), N('updateauth'), [[N('test'), N('active')]], auth]
    r = eosapi.push_transactions2([[act]])
    assert r
    print(r)
    eosapi.produce_block()
Exemple #4
0
def change_active_key():
    key = 'EOS8muoEdY4L9WRYXYB55WmEzYw9A314fW1uMPUqUrFUBMMjWNpxd'
    auth = eosapi.pack_updateauth('test', 'active', 'owner', key, 0)
    act = ['eosio', 'updateauth', [['test', 'active']], auth]
    r = eosapi.push_transactions([[act]])
    assert r