mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
require('../../utils-tests.js').TestRig('ws://localhost:6005').then(t=>
|
|
{
|
|
const account1 = t.randomAccount();
|
|
const account2 = t.randomAccount();
|
|
t.fundFromGenesis(account1).then(()=>
|
|
{
|
|
t.fundFromGenesis(account2).then(()=>
|
|
{
|
|
t.feeSubmit(account1.seed,
|
|
{
|
|
Account: account1.classicAddress,
|
|
TransactionType: "SetHook",
|
|
Hooks: [
|
|
{
|
|
Hook: {
|
|
CreateCode: t.wasm('aaw.wasm'),
|
|
HookApiVersion: 0,
|
|
HookNamespace: "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF",
|
|
HookOn: "0000000000000000"
|
|
}
|
|
}
|
|
]
|
|
}).then(x=>
|
|
{
|
|
t.assertTxnSuccess(x)
|
|
console.log(x);
|
|
t.feeSubmit(account2.seed,
|
|
{
|
|
Account: account2.classicAddress,
|
|
TransactionType: "AccountSet"
|
|
}).then(x=>
|
|
{
|
|
t.assertTxnSuccess(x)
|
|
process.exit(0);
|
|
}).catch(t.err);
|
|
}).catch(t.err);
|
|
}).catch(t.err);
|
|
}).catch(t.err);
|
|
})
|
|
|
|
|
|
|