works for simple case

This commit is contained in:
Greg Hysen
2018-11-09 20:22:48 -08:00
parent 3027e6bc0d
commit 58177060a4
2 changed files with 4 additions and 3 deletions

View File

@@ -81,7 +81,7 @@ export class DependentCalldataBlock extends CalldataBlock {
private parent: CalldataBlock;
private dependency: CalldataBlock;
constructor(name: string, signature: string, /*offsetInBytes: number,*/ relocatable: boolean, parent: CalldataBlock, dependency: CalldataBlock) {
constructor(name: string, signature: string, /*offsetInBytes: number,*/ relocatable: boolean, dependency: CalldataBlock, parent: CalldataBlock) {
const headerSizeInBytes = 0;
const bodySizeInBytes = DependentCalldataBlock.DEPENDENT_PAYLOAD_SIZE_IN_BYTES;
super(name, signature, /*offsetInBytes,*/ headerSizeInBytes, bodySizeInBytes, relocatable);
@@ -174,6 +174,7 @@ export class Calldata {
let block: CalldataBlock | undefined;
let offset = 0;
while ((block = blockQueue.pop()) !== undefined) {
console.log(block.getName());
block.setOffset(offset);
if (block instanceof DependentCalldataBlock) {
blockQueue.push(block.getDependency());

View File

@@ -116,7 +116,7 @@ describe.only('ABI Encoder', () => {
});
it('Types with default widths', async () => {
it.skip('Types with default widths', async () => {
const method = new AbiEncoder.Method(AbiSamples.typesWithDefaultWidthsAbi);
console.log(method);
const args = [new BigNumber(1), new BigNumber(-1), '0x56', [new BigNumber(1)], [new BigNumber(-1)], ['0x56']];
@@ -329,7 +329,7 @@ describe.only('ABI Encoder', () => {
expect(calldata).to.be.equal(expectedCalldata);
});
it.only('Yessir', async () => {
it('Yessir', async () => {
const method = new AbiEncoder.Method(AbiSamples.simpleAbi);
const calldata = method.encode([new BigNumber(5), 'five']);
console.log(calldata);